septemberlogic
Technical User
Hi,
For the following string,
$str = "Vin[i,j] + Vout[i,j] + Uin[i,j] + Uout[i,j]";
I want to replace the i's and j's in the square brackets with actually indices. So something like "$str =~ s/i/2/g", except for that changes the variable name as well (Vin becomes V2n). So my questions is, how do I limit my find-and-replace with in the square brackets?
Thanks in advance!
For the following string,
$str = "Vin[i,j] + Vout[i,j] + Uin[i,j] + Uout[i,j]";
I want to replace the i's and j's in the square brackets with actually indices. So something like "$str =~ s/i/2/g", except for that changes the variable name as well (Vin becomes V2n). So my questions is, how do I limit my find-and-replace with in the square brackets?
Thanks in advance!