perrin has asked for the wisdom of the Perl Monks concerning the following question:
This is my test code. I had to use two steps to extract the row I want and then check it.<tr class="meld"> <th>Security Code Matched</th> <td>N/A</td> </tr>
Caveats about parsing HTML with regexes aside, can anyone think of a way to do this in one regex (i.e. with $mech->content_like)? It's mostly an academic question, since what I have now is working fine.my ($security_code_row) = ($mech->content =~ m{Security Code Matched(.*?)</tr>}s); like($security_code_row, qr{N/A}, 'code matched is N/A');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: combine two-part regex test
by Zaxo (Archbishop) on Jan 29, 2007 at 21:07 UTC | |
|
Re: combine two-part regex test
by AltBlue (Chaplain) on Jan 30, 2007 at 00:24 UTC | |
|
Re: combine two-part regex test
by BrowserUk (Patriarch) on Jan 29, 2007 at 21:11 UTC | |
by perrin (Chancellor) on Jan 29, 2007 at 21:26 UTC | |
by BrowserUk (Patriarch) on Jan 29, 2007 at 22:57 UTC | |
by perrin (Chancellor) on Jan 30, 2007 at 20:12 UTC |