Ask a Question related to PHP Development, Design and Development.
-
apropo #1
REGEX help pls
in the regex buddy they are explaining:
"Be careful when using the negated shorthands inside square brackets.
[\D\S] is not the same as [^\d\s]. The latter will match any character
that is not a digit or whitespace. So it will match x, but not 8. The
former, however, will match any character that is either not a digit, or
is not whitespace. Because a digit is not whitespace, and whitespace is
not a digit, [\D\S] will match any character, digit, whitespace or
otherwise."
why [^\d\s] will match anything not being a digit or a space is clear to
me, but why [\D\S] would not do the same not.
I tested the regex, and it does what they're saying, i just dot get it,
why?
I'd actually expect for [^\D\S] to match what [\D\S] is matching, and
reverse.
Please help. Thanks.
--
"it's not right. it's not even wrong"
apropo Guest
-
Regex help
I'd like to replace any html tags containing "< >" with a space. For example, <TR VALIGN=TOP>, I'd like to replace that with a space. Is there a... -
Regex..
Could some good samaritan help me out with this pls... I am trying to find a regular expression for the below string.. ExchangeName =... -
regex, is this possible?
Hi! I am trying to break down the following: printf("numsteps=%d i=%d im=%g vfr=%g \n",numsteps,i,imeas,vforce); into "numsteps= numsteps ... -
Need help with regex
> I have a directory of files that I want to move to another directory. -
IP regex?
Gareth Glaccum wrote: How about using m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ and testing $1 - $4 for compliance? Much cleaner. -- Cheers, -
sma1king #2
Re: REGEX help pls
"apropo" <unicode0161@yahoo.com> wrote in message
news:opsd75vtwp4kpgqh@laptop...See [url]http://www.tin.org/bin/man.cgi?section=7&topic=regex[/url] for discussion of> in the regex buddy they are explaining:
>
> "Be careful when using the negated shorthands inside square brackets.
> [\D\S] is not the same as [^\d\s]. The latter will match any character
> that is not a digit or whitespace. So it will match x, but not 8. The
> former, however, will match any character that is either not a digit, or
> is not whitespace. Because a digit is not whitespace, and whitespace is
> not a digit, [\D\S] will match any character, digit, whitespace or
> otherwise."
>
> why [^\d\s] will match anything not being a digit or a space is clear to
> me, but why [\D\S] would not do the same not.
> I tested the regex, and it does what they're saying, i just dot get it,
> why?
> I'd actually expect for [^\D\S] to match what [\D\S] is matching, and
> reverse.
> Please help. Thanks.
> --
> "it's not right. it's not even wrong"
effects of
brackets and the "^" character.
George
sma1king Guest



Reply With Quote

