Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Regular Expression For Dreamweaver

$
0
0

So you have a string that starts { and goes until the first }.  Then you have another string exactly the same.  And you want to swap them.  I'm not making any assumption that the second one has to look like a URL (that's a whole other minefield, but perhaps you could do something simple like it must start with http). 

 

You don't specify how your text file is divided up, have you got this as a complete line to itself, or is it just  a huge block of text?  Preferably as individual lines.

 

I don't have Dreamweaver, but this worked for me in Notepad++

 

Find: ^{(.*?)}{(.*?)}$

Replace with: {\2}{\1}

 

My file looked like this:

{Click here to visit my website}{http://www.adobe.com/}

{some other site}{http://www.example.com/foo}

 

And doing a Replace All ended up like this:

{http://www.adobe.com/}{Click here to visit my website}

{http://www.example.com/foo}{some other site}


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>