|
| Hello,
I'm looking for a way to batch clean up many links (a few hundred) in 1 HTML
file.
A regular expression seems what I need but I can't get the syntax working,
probably because I'm not escaping some specail characters.
here are some example links :
<a href='#A001'>read more</a>
<a href='#37'>read more</a>
<a href='#755CTX'>read more</a>
I want to clean up these anchor links by converting them to links that all
point to 1 directory and re-use part of the current anchor as a URL variable
to pass to a certain page.
Like this :
<a href='docs/extra.php?fName=A001'>read more</a>
<a href='docs/extra.php?fName=37'>read more</a>
<a href='docs/extra.php?fName=755CTX'>read more</a>
So the regular expression shoud match anything that starts with :
<a href='#
AND ends with :
>read more</a>
The # character should be replaced by :
docs/extra.php?fName=
Anyone knows how to do this or where I could find a comprehensive tutorial?
Many thanks!
|
|