I'm doing a simple search and replace command in vim and I'm trying to escape the <> and / characters so I can use them in my search expression. I realize there are more elegant ways of finding HTML tags, but what I'm really looking for is a localized search and replace command that will replace <h1>UNKNOWN MISSION</h2> with <h2>UNKNOWN MISSION</h2>. Here's my command where I try to escape the special characters:
:%s/\<h1\>UNKNOWN MISSION\<\/h2\>/\<h2\>UNKNOWN MISSION\<\/h2\>/
The pattern is not matching. Any ideas?
h1withh2? There shouldn't be other text in the document that contains that character combination. And you can do a find and replace by line so you (potentially) wouldn't interfere with other occurrences ofh1.