I have large documents which have some strings in them which look like this:
<font face='Greek1'>D</font>
These are not full fledged html documents (I know RegEx and html is a big no-no), and they are well behaved on this point. The values in between ><
are arbitrary.
The documents are large and I need to do a replace across them so that the line:
<font face='Greek1'>D</font>
looks instead like:
D
I've written this regex:
(<font face='[A-z0-9]*'>)
For pattern matching which takes care of the first section, for any face attribute. The
</font>
is also pretty easy to code up.
If I have code that looks like this:
Pattern pattern = Pattern.compile(MYREGEX);
Matcher matcher = pattern.matcher(MYSTRING);
String clean = matcher.replaceAll("");
Is there a way to write a single pattern which will find and replace on both the first section:
<font face='Greek1'>D</font>
and the second section:
</font>
While leaving whatever arbitrary characters are between the >< in place? Or do I have to do these as two seperate reg-exs?