I have a file with lots of text editing using NotePad++.
for example
<span class="italic">some text</span><span class="bold">another text or some text</span>
I would like to use NotePad++'s regex replace to replace
<span class"italic>some text</span>
to <i>some text</i>
and <span class="bold">another text or some text</span>
to <b>another text or some text</b>
I'm able to match the span text however How to replace them with NotePad++
Find <span class="italic">text12312</span>
and replace it with <i>[a-zA-Z]*</i>
will actually put the "[a-zA-Z]*"
text into replaced string and not "text12312"
.
Open the text file in Notepad. Click Edit on the menu bar, then select Replace in the Edit menu. Once in the Search and Replace window, enter the text you want to find and the text you want to use as a replacement. See our using search and replace and advanced options section for further information and help.
<span class="italic">([^<]+)</span>
=> <i>\1</i>
<span class="bold">([^<]+)</span>
=> <b>\1</b>
[^<]+
matches one or more of any character except <
, and the parentheses capture it in group #1. \1
inserts the captured text into the replacement string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With