romain.jouin@gmail.com wrote:
[color=blue]
> Yannick Benoit a écrit :
>[color=green]
>>[:space:]*(href)[:space:]*=[:space:]*([^ >]+)[/color][/color]
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.
[color=blue]
> [ ]*href[ ]*=[ ]*([^>]+)[/color]
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