Note that it assumes the tag already has a value attribute (either set or empty).my $newvalue = "foobar"; foreach (<DATA>) { s/(<input .+? value=["']).*?(["'].*?>)/$1$newvalue$2/; print; } __DATA__ <input type="text" value=""> <input type="password" name="moo" value="fish" /> <input type="text" value=''/>
In reply to Re: Pattern Matching and replacement
by The Mad Hatter
in thread Pattern Matching and replacement
by Feral_Shade
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |