in reply to regex not working..
The metacharacter "^" anchors your match to the left side of the string. The characters from your target string found at the left side of the string are "NOTICE", not "PASS". It's impossible for your target string to match [lefthand side of string]PASS.
Perhaps change it to:
m{/QUOTE\sPASS\s(\S+)$}
That anchors to "/QUOTE PASS ", and then captures any non-space characters through the end of the string. If it's permissible to have space characters embedded within the field, change it to:
m{/QUOTE\sPASS\s(.+)$}
And if the field is optional:
m{/QUOTE\sPASS(?:\s(.+))?$}
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex not working..
by Anonymous Monk on May 12, 2012 at 16:55 UTC | |
by AnomalousMonk (Archbishop) on May 12, 2012 at 17:35 UTC | |
by Anonymous Monk on May 12, 2012 at 17:52 UTC | |
by Corion (Patriarch) on May 12, 2012 at 18:00 UTC | |
by AnomalousMonk (Archbishop) on May 12, 2012 at 18:16 UTC | |
by aaron_baugher (Curate) on May 13, 2012 at 01:38 UTC |