Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have to match multiple things in a regex and on top of that I need to match things in pairs. To keep things in insertion order I was thinking of creating an array and just combining match1::match2 and ripping through them later on. But since I need the URL and name for each of the urls, that's a little much for an array, isn't it?
Code I need to match is as follows
There are hundreds of these matches per page and I NEED to pair up the first and second link of each match. Also, the TR CLASS alternates between "g" and "h" each time.<TR class=g><TD class=i><A href="/page1.html">Page name here</A></TD>< +TD class=j><A href="/page2.html">Other page name here</A></TD></TR> <TR class=h><TD class=i><A href="/blahblah.html">lah blah</A></TD><TD +class=j><A href="/ribbit.html">Ribbit</A></TD></TR>
Any advice on the regex to use for this to mach the URL and the title of each set AND how to group this together for easy access later (preferrably in the order it's found) would be great.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multiple regex matching
by tlm (Prior) on Apr 13, 2005 at 22:10 UTC | |
|
Re: multiple regex matching
by gam3 (Curate) on Apr 14, 2005 at 00:52 UTC | |
by Anonymous Monk on Apr 14, 2005 at 01:10 UTC | |
by Cody Pendant (Prior) on Apr 14, 2005 at 01:28 UTC | |
|
Re: multiple regex matching
by Cody Pendant (Prior) on Apr 13, 2005 at 23:58 UTC | |
by Anonymous Monk on Apr 14, 2005 at 00:12 UTC | |
by Cody Pendant (Prior) on Apr 14, 2005 at 01:22 UTC | |
|
Re: multiple regex matching
by Popcorn Dave (Abbot) on Apr 14, 2005 at 19:37 UTC |