Notepad++ is another Windows-based free (OSS) editor that will do regular-expression search & replace, and can do it across multiple files/directories on disk (i.e. not loaded into the editor).
http://notepad-plus-plus.org/
JoelKatz, it is of course trivial to fix your REs to handle spaces in the tags. The -i option to sed will also avoid the mv, but doesn't keep a backup. There is also a better way to make it case insensitive:
Code:
cp -i "${FNM}" "${FNM}.bak"
sed -e "s:</? *span *>::gi" -i "${FNM}"
Also, if you don't want to bother with Cygwin, but want sed & friends, got to gnuwin32.sourceforge.net.
ETA: Don't pipe sed commands together like that; you can provide multiple -e options to sed:
Code:
sed -e "s:</? *div *>::gi" -e "s:</? *span *>::gi" -i "${FNM}"
By the way, here's the Windows command line equivalent, if you download and install sed from gnuwin32:
Code:
for /r %f in (*.htm *.html) do (
copy "%f" "%f.bak"
sed -e "s:</? *div *>::gi" -e "s:</? *span *>::gi" -i "%f"
)
ETA2: Yuck. sed doesn't have the RE ? operator, it seems. Use * instead, although it's less restrictive, or multiple REs as originally suggested.
Here's a RE that will also catch options on the tags (but needs spaces after the div: