in reply to help required for regexp

I want to replace the string and make it

Simply assign a new value to the variable, regexp are slow, don't use it if you can cheat:

 $str = "f1_2_3";