Re: [PHP] Regular Expression Backreference in subpattern.

2008-09-27 Thread Shiplu
On 9/27/08, Richard Lynch <[EMAIL PROTECTED]> 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: > > '|\\s*charge\\s*\\s*\\s*([0-9]*)\\s*|' > > \\s allows for whitespace > > If you only want ones that HAVE

RE: [PHP] Regular Expression Backreference in subpattern.

2008-09-27 Thread Richard Lynch
Not sure what you think the (?P is doing, but it looks very suspicious to me... I'm no PCRE expert though... Try this: '|\\s*charge\\s*\\s*\\s*([0-9]*)\\s*|' \\s allows for whitespace If you only want ones that HAVE to have numbers, and no blanks, change * after the 0-9] bit into + _