Suppose I have a long java String , I need to wrap all whitespaces (length >=2) with <pre></pre>
tag... , How to achieve that ?
ex :
before :
String str = "<font color=\"#000000\">A B C D</font>"
after :
<font color=\"#000000\">A B<pre> </pre>C<pre> </pre>D</font>
Between A and B is one whitespace , and not wrapped.
Between B and C is two whitespaces , and it is wrapped.
Between C and D is three whitespaces , and it is wrapped,too.
How to achieve that in RegExp ? Thanks a lot !