I need to match the following
What I have so far is<li><a class="style5" href="http://www.site.com/page.html"> some words here</a> - <a class="style3" href="http://www.site.com/page2.html"> "some words here"</a> </li>
What I need to match: $1 = the text inside the first link's text, $2 = the 2nd link's URL, $3 - the 2nd link's text.push (@results, "$1::$2::$3"), $result_content =~ m#style="5" href +=".+">\s+(.+)?</a>\s+-\s+\<a class="style3" href="(.+)?">(.+)?</a>#gi +s;
The links can be any links, so I'm not literally matching for this one, of course. Sometimes there are quotes in the 2nd link's text, sometimes it's a ' instead of ", so I just want to match whatever is in that text part. There are infinitely many of these.
If someone can show me how to fix this I'd be very much appreciative. Also if someone can show me how to do this with one of those modules people use for HTML regexes so it's more stable, I'd be very interested to see how it's done.
In reply to 3 capture multi line regex by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |