absentx
absentx

Reputation: 1417

Regular Expression, searching code in Dreamweaver

I just need to search some code and find the following, using the find and replace with regular expressions in Dreamweaver:

<div id ="specific_div"> anything can be in here </div>

I have not really tried to tackle regular expressions yet, but I am having trouble figuring out how to tell it that "I don't care what is in between the div tags, but please find me this specific div tag, everything in it and the closing div tag!"

Upvotes: 0

Views: 599

Answers (1)

inhan
inhan

Reputation: 7470

There's a 'specific tag' option under the 'search' list in the 'Find and Replace' window. Why don't you use it? Anyway I'd probably use something like the following. But it won't select all the node if there's an idenatical closing tag <div> inside that div.

<div\b(.*?)(\bid)\s*=\s*("|')specific_div\3([\w\W]*?)</div>

I didn't close the opening tag because I thought you might have other attributes in that node. Oh and make sure the 'Match Case' option is not selected in the search window.

Upvotes: 1

Related Questions