|
Posted by John Dunlop on 09/18/05 12:01
romain.jouin@gmail.com wrote:
> Yannick Benoit a écrit :
>
>>[:space:]*(href)[:space:]*=[:space:]*([^ >]+)
A named character class, itself inside a character class, has to be
wrapped in '[:' and ':]'. So here you would have /[[:space:]]/. The
Manual does not document this for PCREs.
What you have at the moment, in a POSIX regular expression, are
ordinary character classes. (You'd get an error if you tried that in
a PCRE.) Since they don't match US-ASCII spaces, the only way the
pattern could match is if the subject string doesn't have spaces at
those points.
> [ ]*href[ ]*=[ ]*([^>]+)
A character class consisting of a single character means the same if
you remove its square brackets. The classes are superfluous.
/ */ and /[[:space:]]*/ don't necessarily have the same meaning.
The latter likely matches the usual whitespace characters, the former
only US-ASCII spaces.
--
Jock
[Back to original message]
|