OfficeLinebacker has asked for the wisdom of the Perl Monks concerning the following question:
I have the following snippet of code where I am parsing some HTML to get a piece of text. I have split up the HTML into chunks and a typical chunk might look like
The part I want is "Moving Services for MSCD Student Success Building" or whatever text is in that TD. My code goes like this:/td><td class="stdViewCon">Moving Services for MSCD Student Success Bu +ilding</td></tr></table></TD></TR> <TR VALIGN=top><TD><table class="stdViewITbl"><tr><td class="stdViewLn +kLbl">
where the $pieces variable holds that chunk.$pieces[4] =~ m/>(^<+)</; my $title = $1;
First of all, why isn't this working?
Second of all, is there a better "Best Practices" way to do the RE match and store in $title?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question why this Regex isn't matching
by pvaldes (Chaplain) on Sep 30, 2011 at 20:43 UTC | |
|
Re: Question why this Regex isn't matching
by OfficeLinebacker (Chaplain) on Sep 30, 2011 at 17:29 UTC | |
by AnomalousMonk (Archbishop) on Sep 30, 2011 at 17:46 UTC | |
by OfficeLinebacker (Chaplain) on Sep 30, 2011 at 17:53 UTC | |
by ww (Archbishop) on Sep 30, 2011 at 18:54 UTC |