Re: Regular Expression Backreference in subpattern.

From: Date: Sat, 27 Sep 2008 17:07:10 +0000
Subject: Re: Regular Expression Backreference in subpattern.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-281050@lists.php.net to get a copy of this message
On 9/27/08, Richard Lynch <rlynch@peak6.com> wrote: > Not sure what you think the (?P is doing, but it looks very suspicious to me... > > I'm no PCRE expert though... > > Try this: > > '|<td>\\s*charge\\s*</td>\\s*<td>\\s*([0-9]*)\\s*</td>|' > > \\s allows for whitespace > > If you only want ones that HAVE to have numbers, and no blanks, change * after the 0-9] bit > into + > It doesnt need \\s or \s. Because I have given the string. \s* is okay though. Well, ?P is 100% okay with PCRE. it gives name subpattern matches (details: http://www.php.net/manual/en/regexp.reference.php); -- Blog: http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu

« previous php.general (#281050) next »