Below is my codes:
And the actual output:
What I expect:
could someone please tell me what is wrong in my code?
Thanks.
Code:
my $string1 = '<td><a href="[URL unfurl="true"]http://www.aaa.com/downloads/details.aspx?FamilyID=a1b2c3">abcdefg</a><br[/URL] />(123456)</td>';
my $string2 = '[URL unfurl="true"]http://www.aaa.com/downloads/details.aspx?FamilyID=a1b2c3';[/URL]
print "Before string substitution:\n$string1\n";
$string1 =~ s/$string2//;
print "After string substitution:\n$string1\n";
And the actual output:
Code:
Before string substitution:
<td><a href="[URL unfurl="true"]http://www.aaa.com/downloads/details.aspx?FamilyID=a1b2c3">abcdefg</a><br[/URL] />(123456)</td>
After string substitution:
<td><a href="[URL unfurl="true"]http://www.aaa.com/downloads/details.aspx?FamilyID=a1b2c3">abcdefg</a><br[/URL] />(123456)</td>
What I expect:
Code:
Before string substitution:
<td><a href="[URL unfurl="true"]http://www.aaa.com/downloads/details.aspx?FamilyID=a1b2c3">abcdefg</a><br[/URL] />(123456)</td>
After string substitution:
<td><a href="">abcdefg</a><br />(123456)</td>
could someone please tell me what is wrong in my code?
Thanks.