I am using c# regex.replace and I want to replace this string:
test = "<p align=\"center\"><b><font size=\"4\">RWGRF-W02PS-PU-BU-FLD</font></b></p>";
with: <center><b><font size=\"4\">RWGRF-W02PS-PU-BU-FLD</font></b><center>";
Now I could quite easily do this with two calls to replace but the
is used for lots of things, so I need to do it in one go, is there anyway to do this replace all in one call to regex?
Ive tried using .+ to match anything in the middle of the string, but then it obviously replaces the entire middle of the string as well, I want it to ignore that part of the string and not touch it, I know there is a way I just can’t figure it out. Also I appreciate answers but if someone can explain how it works that would be even better 🙂
Thanks!
I would store the match with parenthesis, and then replace it.