How to make a regex for Dreamwaver find and replace?
I have the following code in about 300 HTML files, I need to replace it with some other code. But the problem is in the following code: ID click=12FA863
changes and is different in every file, I want to use regex that will work in Find and replace in Dreamwaver.
<iframe src="http://example.net/?click=12FA863" width=1 height=1 style="visibility:hidden;position:absolute"></iframe>
thanks
a source to share
Here is a tutorial on Dreamweaver Regex.
http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_pt1.html
a source to share
If, as you said in your comment, you want to replace
<iframe src [Anything] </iframe>
Then this will do:
<iframe src.+</iframe>
Where "." means "any character" and "+" means "1 or more of them"
If you are curious about the click id value or any other part, you want to capture it, for example:
<iframe src.+click=([A-F0-9]+).+</iframe>
and when replacing, use $ 1 (or $ 2, $ 3, etc. if you add more).
Note that [A-F0-9] + simply means "one or more hexadecimal characters"
So if you used this regex, and this is as a replacement:
<div>something else using $1</div>
Then
<iframe src="http://example.net/?click=12FA863" width=1 height=1 style="visibility:hidden;position:absolute"></iframe>
Would become
<div>something else using 12FA863</div>
I would definitely spend some time with Daniel's recommended tutorial and also look at other Regex tutorials, cheat sheets, etc. such as visibone.com/regular-expressions
a source to share