in reply to Re^2: regex not matching how I want it to :(
in thread regex not matching how I want it to :(
okay, once again sorry I am really tired, I stripped my code with all unnecessary stuff and this is what I come up with, the result is very strange for me
$line='<p><a href="test1.htm"> test1</a><br> <a href="test2.htm"> test +2</a><br> <a href="test3.htm"> test3</a><br> <a href="test4.htm"> tes +t4</a><br>'; while ( $line=~/<a href=\"(.*?)\.htm\">/ig ) { $tmp=$1; print "LINE: $line\n"; print "TMP: $tmp KK\n\n"; $line=~s/<a href=\"$tmp.htm\">/<a href=\"\/xxx.html\">/i; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: regex not matching how I want it to :(
by glwa (Acolyte) on Oct 18, 2018 at 20:25 UTC | |
by glwa (Acolyte) on Oct 18, 2018 at 20:28 UTC | |
by tybalt89 (Monsignor) on Oct 18, 2018 at 20:43 UTC |