Reputation: 57
I have a lot of php pages. Every php page has inside a string like this:
<FONT COLOR="#0000FF">Post ID: 16107</FONT>
and I'd like to replace with:
<A HREF="#16107">Post ID: 16107</A>
but since every php page has a different Post ID and I'd like to match every occurrence of the string... I use as usually notepad2 witch supports regex and notepad++ too that supports regex as well. How can I replace all strings into all files into all dirs? Are about 350 files...
Upvotes: 0
Views: 933
Reputation: 1845
Replace: <FONT COLOR=".*?">(Post ID: ([0-9]+))</FONT>
With: <A HREF="#\2">\1</A>
Upvotes: 2
Reputation: 1615
search for
<FONT COLOR=".*?">Post ID: (\d+)<\/FONT>
replace with
<A HREF="#$1">Post ID: $1<\/A>
Upvotes: 1
Reputation: 747
Good to know this is possible:
In Notepad++ you'd need to search for Keep ID: ([0-9]*)
and replace it with New ID: $1
.
$0
represents the whole thing found, $1
the first found in brackets.[]
to create a class (in this case of numbers 0 to 9)Upvotes: 0