You are here: Re: need help with a regs expression « PHP Programming Language « IT news, forums, messages
Re: need help with a regs expression

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация