mpalmer12345
Programmer
$text = '<input type=hidden name="avkw" value="fogg">
<input type=hidden name="avkw" value="a be cee">';
Given this bit of code above, I wish to write a line that replaces all words between every instance of value="" with an equal number of xs. So the result should be:
<input type=hidden name="avkw" value="xxxx">
<input type=hidden name="avkw" value="x xx xxx">
I am this far towards a solution, but it doesn't work. I can't figure out why.
$t2 = $text;
$t2 =~ s/value="(^"*?)"/$repl x length($1)/ige;
$text =~ s/(value=")(^"*?)(")/$1$t2$3/ig;
Any assistance would be much appreciated!
<input type=hidden name="avkw" value="a be cee">';
Given this bit of code above, I wish to write a line that replaces all words between every instance of value="" with an equal number of xs. So the result should be:
<input type=hidden name="avkw" value="xxxx">
<input type=hidden name="avkw" value="x xx xxx">
I am this far towards a solution, but it doesn't work. I can't figure out why.
$t2 = $text;
$t2 =~ s/value="(^"*?)"/$repl x length($1)/ige;
$text =~ s/(value=")(^"*?)(")/$1$t2$3/ig;
Any assistance would be much appreciated!