and I want to find certain tags using this code snippet, and output a qif file. The problem I'm having is in matching the start and end tags.<tr><td bgcolor='#DCDCDC' align='left' width='100'><font face='arial,h +elvetica' size='-2'> 28 Jun 2001</font></td><td bgcolor='#DCDCDC +' + align='left' width='300'><font face='arial,helvetica' size='-2'>&nbs +p +;HMV UK LTD NOTTINGHAM GB</font></td><td bgcolor='#DC +D +CDC' align='right' width='75'><font face='arial,helvetica' size='-2'> +& +pound;10.99 </font></td></tr><tr><td bgcolor='#DCDCDC' align='l +e +ft' width='100'><font face='arial,helvetica' size='-2'> 28 Jun 2 +0 +01</font></td><td bgcolor='#DCDCDC' align='left' width='300'><font fa +c +e='arial,helvetica' size='-2'> MARKS SPENCER NOTTINGHA +M + 06 GB</font></td><td bgcolor='#DCDCDC' align='right' width='75'><fon +t + face='arial,helvetica' size
It never seems to match the start tag, and if I change the start tag to something simpler like$start="<td bgcolor=\'#DCDCDC\' align=\'left\' width=\'300\'><font fac +e='arial,helvetica' size='-2'> "; $end="</font></td>"; while (<>) { if (/$start(.*?)$end/g) { print "\n\n\nDOODAH:".$1."\n"; } }
then the perl never seems to stop when it hits something that matches the $end var. I've been going round and round this and I just can't figure it out, so any advice would be greatly appreciated. Cheers moonlord$start="<td bgcolor";
In reply to html tag matching confusion by moonlord
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |