nr0mx has asked for the wisdom of the Perl Monks concerning the following question:
and I need to replace table1.column3 with some dummy id. I'm trying the following one-liner without any success. Any ideas ? If I slurp the file into a single-line string it works, but in multi-line mode it doesn't replace the desired string. What am I missing here ? Isn't the /s modifier supposed to do the matching across newlines ?thisquery=select \ table1.column1, \ table1.column2, \ table1.column3 alternate_title, \ table1.column4 \ from \ table1 \ where \
A very confused monk!perl -pi -e 's/select(.*?)table1\.column3(.*?)from/select\1DUMMY_ID\2f +rom/sg' select.sql
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with a multi-line regexp
by Zaxo (Archbishop) on Aug 27, 2004 at 14:19 UTC | |
|
Re: Problem with a multi-line regexp
by davido (Cardinal) on Aug 27, 2004 at 14:16 UTC | |
|
Re: Problem with a multi-line regexp
by ysth (Canon) on Aug 27, 2004 at 14:22 UTC |