Edit this post to add morre infor mation about I have done so far My expected output is:
one line
echo number_format($row1[$z+1],4,",",".");
echo "<b><font color=red>".number_format($mount_01,4,",",".")."</font></b>";
echo "<b><font color=red>".number_format($mount_02,4,",",".")."</font></b>";
other line
<td bgcolor="red"><b><font color="white"><?echo number_format($general,4,",",".");?></font></b></td>
another line
<td><font size=4><b><?echo number_format($sum_total,4,",",".");?></font></b></td>
I can gey this result with the solution proposed by Romeo Ninov, but it only works on the screen and don't save the changes. Tha's why I Want to do it with sed, more if I want to change all file in a directory.
I divided the expresion containg the function number format in three regular expresion
number_format\(\$([a-zA-Z0-9_]{1,}(\[\$[a-zA-Z0-9_]{1,}\+[a-zA-Z0-9]{1,}(\]))*,))
[0-9], what I want to change and
(\,\"\,\"\,\"\.\"\))
if I try this code:
sed -E 's/(number_format\(\$([a-zA-Z0-9_]{1,}(\[\$[a-zA-Z0-9_]{1,}\+[a-zA-Z0-9]{1,}(\]))*,))/\14/' file
it gives me:
one line
echo number_format($row1[$z+1],42,",",".");
echo "<b><font color=red>".number_format($mount_01,42,",",".")."</font></b>";
echo "<b><font color=red>".number_format($mount_02,42,",",".")."</font></b>";
other line
<td bgcolor="red"><b><font color="white"><?echo number_format($general,42,",",".");?></font></b></td>
another line
<td><font size=4><b><?echo number_format($sum_total,42,",",".");?></font></b></td>
and if I use the last regex
sed -E 's/(\,\"\,\"\,\"\.\"\))/4\1/' file
gives me
one line
echo number_format($row1[$z+1],24,",",".");
echo "<b><font color=red>".number_format($mount_01,24,",",".")."</font></b>";
echo "<b><font color=red>".number_format($mount_02,24,",",".")."</font></b>";
other line
<td bgcolor="red"><b><font color="white"><?echo number_format($general,24,",",".");?></font></b></td>
another line
<td><font size=4><b><?echo number_format($sum_total,24,",",".");?></font></b></td>
But if I combine the first and las regex doesn't work it returs the original file without changes
sed -E 's/(number_format\(\$([a-zA-Z0-9_]{1,}(\[\$[a-zA-Z0-9_]{1,}\+[a-zA-Z0-9]{1,}(\]))*,))(\,\"\,\"\,\"\.\"\))/\14\2/' file
one line
echo number_format($row1[$z+1],2,",",".");
echo "<b><font color=red>".number_format($mount_01,2,",",".")."</font></b>";
echo "<b><font color=red>".number_format($mount_02,2,",",".")."</font></b>";
other line
<td bgcolor="red"><b><font color="white"><?echo number_format($general,2,",",".");?></font></b></td>
another line
<td><font size=4><b><?echo number_format($sum_total,2,",",".");?></font></b></td>
So, how to make it work?