This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > May 2004 > need help with regular expression in Dreamweaver





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author need help with regular expression in Dreamweaver
joris

2004-05-28, 7:15 pm

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!



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews