Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I need a regex for the below lines but i can only think of multiple solutions which seems wasteful.
In a file i may have:
gif"></td><td>XXX</td></tr> gif"></td><td>XXX</td></tr> gif"></td><td><b>XXX</td><td><b>yyy</td></tr>
I need to match the XXX section which may have the characters A-Z0-9()[]. yyy only exists for those lines with and will have the same character types has XXX but i want to ignore them.
I have the following:
m/gif\S+<td><b>(\S+)<\/td><td><b>[A-Z]/; m/gif\S+<td>(\S+)<\/td><td><b>[A-Z]/; m/gif\S+<td>(\S+)<\/td><\/tr>$/;
Thanks
Edited by planetscape - fixed bold, code, etc. markup
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Match Problem
by McDarren (Abbot) on Mar 20, 2006 at 12:08 UTC | |
by Anonymous Monk on Mar 20, 2006 at 12:22 UTC | |
by ayrnieu (Beadle) on Mar 21, 2006 at 22:34 UTC | |
|
Re: Pattern Match Problem (OT Observation)
by ww (Archbishop) on Mar 20, 2006 at 14:28 UTC | |
|
Re: Pattern Match Problem
by TedPride (Priest) on Mar 20, 2006 at 18:15 UTC | |
|
Re: Pattern Match Problem
by Anonymous Monk on Mar 20, 2006 at 23:32 UTC |