use warnings; use strict; while (<DATA>) { s/"(.+?)"/"NEW"/; print; } __DATA__ This is line 1 "hello there" the is line 2 "goodbye, take care" this is line 3 "Jump, fox. Jump"
prints:
This is line 1 "NEW" the is line 2 "NEW" this is line 3 "NEW"
In reply to Re: Regex: Changing $1
by toolic
in thread Regex: Changing $1
by packetstormer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |