I’m in notepad++ and I need to add a / right before the closing > in the following line:
<meta name="description" content="*****">
the ***** above is a bunch of text that I need left in place, and it changes from page to page, thus my need for some find / replace method that is superior to what I would normally be capable of. I assume regex would be the right way to go.
This seems to do the trick for me (in NP++):
Find:
(<meta name="description" [^>]+)>Replace with:
\1/>Has some caveats, but it’ll work for a simple search/replace, which it sounds like you’re doing. Was I right in assuming that you’re trying to only do this on
<meta>tags with attributes ofname="description"?Edit – Tested it with the Replace All button and went from this:
To this: