rael9 has asked for the wisdom of the Perl Monks concerning the following question:
An example of the text to be parsed is:grep s/(<Bz8>)([^ ]*)/$1$2<\$>/, @FILE;
If I'm not mistaken, my code should return:<*ra0*p(9,-9,0,9,0,0,g,"U.S. English")><Bz8>ATTN: Out of school youth +16-21. Get help to finish high school and/or find job training, and g +et a good job. Call "Options": ask for Kathy M. at EASTCONN 111-1111.
But instead it returns:<*ra0*p(9,-9,0,9,0,0,g,"U.S. English")><Bz8>ATTN:<$> Out of school you +th 16-21. Get help to finish high school and/or find job training, an +d get a good job. Call "Options": ask for Kathy M. at EASTCONN 111-11 +11.
Am I doing it wrong? I am a relative newb, so I may have just misread the documentation. Any help in this regard is much appreciated.<*ra0*p(9,-9,0,9,0,0,g,"U.S. English")><Bz8><$>ATTN: Out of school you +th 16-21. Get help to finish high school and/or find job training, an +d get a good job. Call "Options": ask for Kathy M. at EASTCONN 111-11 +11.
20040904 Edit by castaway: Changed title from 'Regular expression hell'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing Quark file with RegEx
by ikegami (Patriarch) on Sep 03, 2004 at 20:33 UTC | |
by ikegami (Patriarch) on Sep 03, 2004 at 21:09 UTC | |
by rael9 (Novice) on Sep 03, 2004 at 21:15 UTC | |
by ikegami (Patriarch) on Sep 03, 2004 at 21:23 UTC | |
by rael9 (Novice) on Sep 03, 2004 at 20:56 UTC | |
|
Re: Parsing Quark file with RegEx
by Eimi Metamorphoumai (Deacon) on Sep 03, 2004 at 20:25 UTC | |
|
Re: Parsing Quark file with RegEx
by lidden (Curate) on Sep 03, 2004 at 20:35 UTC | |
|
Re: Parsing Quark file with RegEx
by TheEnigma (Pilgrim) on Sep 03, 2004 at 20:42 UTC | |
|
Re: Parsing Quark file with RegEx
by rael9 (Novice) on Sep 03, 2004 at 21:10 UTC | |
by TimToady (Parson) on Sep 04, 2004 at 02:15 UTC | |
by ikegami (Patriarch) on Sep 03, 2004 at 21:12 UTC | |
|
Re: Parsing Quark file with RegEx
by rael9 (Novice) on Sep 07, 2004 at 19:08 UTC | |
by Eimi Metamorphoumai (Deacon) on Sep 07, 2004 at 20:08 UTC |