B
boris bass
i am trying to scan the html file for all the anchor tags and the
following regex
while ( $content =~ /<\s*a\s+.*?>/s )
doesn't seem to work , what is wrong here?
angle brackets don't need to be escaped, do they?
obviously, the string i am trying to match is
<a href="something">
but i get no match
ps. this could probably be done via HTML:arser module and not
through the regular expressions.
the task i am trying to accomplish: find
<a href="something">
and change it to
<a href="">
i.e. delete a link to whatever and leave an empty string in place of
it.
if somebody could post a code snippet how to do it would also be
appreciated. doesn't have to be tested, just to point me at the right
direction. i looked at html:arser doc page, but i haven't figured it
out on my own
thanks,
boris
following regex
while ( $content =~ /<\s*a\s+.*?>/s )
doesn't seem to work , what is wrong here?
angle brackets don't need to be escaped, do they?
obviously, the string i am trying to match is
<a href="something">
but i get no match
ps. this could probably be done via HTML:arser module and not
through the regular expressions.
the task i am trying to accomplish: find
<a href="something">
and change it to
<a href="">
i.e. delete a link to whatever and leave an empty string in place of
it.
if somebody could post a code snippet how to do it would also be
appreciated. doesn't have to be tested, just to point me at the right
direction. i looked at html:arser doc page, but i haven't figured it
out on my own
thanks,
boris