When upgrading a website you might see source code like this:
<span style="font-family: Arial; color: #0000ff; font-size: small;">Some text goes here</span>
You’re using CSS now and all those <span> tags are ruining it. In gvim, do this search and substitute:
%s/<span.\{-}>//g
Then to get rid of the </span> tags, do this:
:%s/<\/span>//g
Comments 4
How would I enter this F&R in the GUI version of gVim? I have a a dozen XML files with a ton of articles in them and I need to scrape out a few thousand span tags, but when I search for your term, I get pattern not found. Any help would be great!
With your gvim window active, on the keyboard hit “esc” and then shift-semicolon (to give you a colon, and put you in command mode – I think that’s what it’s called) and then %sblahblahblah
Good luck, the learning curve is steep but you will get a lot of power!
Sorry should have taken the time to really read what you’re asking… assuming you’re replacing the word “span” with whatever XML tag you want to get rid of, you should be right.
Oh man this is good. This is *exactly* what I needed! Thanks so much!