I've got the following source:
<font color="black">0</font><font color="white">1101100001001101</font><font color="black">1</font><font color="white">0110</font>
And would like to replace all white 1
and 0
with spaces. I can match them easily with
/<font color="white">([10]*)</font>/g
Is there a replace pattern (I'm using PHP) to generate the same number of spaces for the matching group $1
?
The result should look like this:
<font color="black">0</font><font color="white"> </font><font color="black">1</font><font color="white"> </font>
(And please ignore the fact that I'm parsing HTML with regexs here. I'm more interested in the solution to the regex problem than in the HTML.)