Search Replace Multiple Lines With Option To Ignore Whitespace
Submitted by Wednesday, 10 November, 2004 - 06:23
on
For people who get stuck doing search/replace in HTML oftentimes, what you are searching for is multiple lines of text. Also, you tend to want to replace with multiple lines of text. Here is an example:
Search:
<table width="100%">
<tr><td>
Hello World
</tr></td>
</table>
Replace:
<table width="100%" class="somestyle">
<tr><td class="hello">
Hello
</tr></td>
<tr><td class="world">
World
</tr></td>
</table>
In other words, instead of using a text field, an option to use a text area for multiple lines would be great.
Furthermore, an option to ignore whitespace differences in the the search string would be great!. For example these would both match when I searched for Hello World!:
Search Matches:
Hello Wo
rld
Search Matches:
Hello World
You could of course use a regular expression for this. However, when search/replacing large amounts of multi-line text with HTML and other weird characters, escaping all the special characters for a regular expression usage would really suck and take a long time. A simple "ignore whitespace difference" checkbox would be much nicer.
My two cents!
Mike
Search:
<table width="100%">
<tr><td>
Hello World
</tr></td>
</table>
Replace:
<table width="100%" class="somestyle">
<tr><td class="hello">
Hello
</tr></td>
<tr><td class="world">
World
</tr></td>
</table>
In other words, instead of using a text field, an option to use a text area for multiple lines would be great.
Furthermore, an option to ignore whitespace differences in the the search string would be great!. For example these would both match when I searched for Hello World!:
Search Matches:
Hello Wo
rld
Search Matches:
Hello World
You could of course use a regular expression for this. However, when search/replacing large amounts of multi-line text with HTML and other weird characters, escaping all the special characters for a regular expression usage would really suck and take a long time. A simple "ignore whitespace difference" checkbox would be much nicer.
My two cents!
Mike