Re: Re: Another RegEx Question
| From: | Peter Lind | Date: | Mon, 07 Jun 2010 16:35:20 +0000 |
| Subject: | Re: Re: Another RegEx Question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305890@lists.php.net to get a copy of this message | ||
On 7 June 2010 18:26, Ashley Sheridan <ash@ashleysheridan.co.uk> wrote:
> On Mon, 2010-06-07 at 13:18 -0300, Jo?o C?ndido de Souza Neto wrote:
>
>> May be this:
>>
>> /.*?[(@#$%].*/
>>
>> "Floyd Resler" <fresler@adex-intl.com> escreveu na mensagem
>> news:3C7C9EE4-786E-4447-859E-AD055635986D@adex-intl.com...
>> I need to test for the existence of at least one punctuation (@#$%')
>> character in a string. What would my regular expression be?
>>
>> Thanks!
>> Floyd
>>
>>
>>
>
>
> You don't need the . character there to match anything. Also, ( and $
> have a special meaning in regex, so should be escaped to avoid any
> confusion or problems.
>
( and $ have no special meaning inside square brackets - you don't
need to escape them there.
Regards
Peter
--
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>