in reply to Regex: Changing $1
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"
|
|---|