Re: URGENT. Re: multi-line regex question, please help!

2002-07-02 Thread John W. Krahn
Robert Hanson wrote: > > > ...how to execute a ***multi-line*** match. > > $_ =~ s/^(M\d+)\n^(.*)/A $1\nB $2/mi; > > ...i am trying to match the first line, beginning > > with M followed by consecutive digists... > > You are confused about what a "multi-line" match is. A "multi-line" match > wi

RE: URGENT. Re: multi-line regex question, please help!

2002-07-02 Thread M z
?:^|\n)(M\d+)\n([^\n]*)/A $1\nB $2/si; > print $_; > > Rob > -Original Message- > From: M z [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 02, 2002 2:08 PM > To: Connie Chan > Cc: [EMAIL PROTECTED] > Subject: URGENT. Re: multi-line regex question, > ple

Re: multi-line regex question, please help!

2002-07-02 Thread John W. Krahn
M Z wrote: > > Dear all, Hello, > I am truly bewildered as to why I can't get this > script to do what I want. Namely, to get the > multiline match. Please help see section of code > surrounded by for question area > > sample input: > > M0011 > XYZabcdefh > > #!C:/perl/bin -w

RE: URGENT. Re: multi-line regex question, please help!

2002-07-02 Thread Hanson, Robert
if I understand correctly... $_ = " M0011 spaceXYZabcdefh "; $_ =~ s/(?:^|\n)(M\d+)\n([^\n]*)/A $1\nB $2/si; print $_; Rob -Original Message- From: M z [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 02, 2002 2:08 PM To: Connie Chan Cc: [EMAIL PROTECTED] Subject: URGENT. Re: multi-line rege

URGENT. Re: multi-line regex question, please help!

2002-07-02 Thread M z
> Beside, seems you fotgot to close ; close =) > > Smiley Connie =) > > > > - Original Message ----- > From: "M z" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 02, 2002 8:51 AM > Subject: multi-line regex question, p

Re: multi-line regex question, please help!

2002-07-02 Thread drieux
On Monday, July 1, 2002, at 05:51 , M z wrote: > sample input: > > M0011 > XYZabcdefh [..] > while () { > s/^ +//gi; > ###below, I think I count for M0011 in $1 > ###then, i thought by using the /m modifier, > ###i could but a caret after the \n > ###this doesn't work for me, please help >

Re: multi-line regex question, please help!

2002-07-02 Thread Connie Chan
AM Subject: multi-line regex question, please help! > Dear all, > > I am truly bewildered as to why I can't get this > script to do what I want. Namely, to get the > multiline match. Please help see section of code > surrounded by for question area > >

multi-line regex question, please help!

2002-07-02 Thread M z
Dear all, I am truly bewildered as to why I can't get this script to do what I want. Namely, to get the multiline match. Please help see section of code surrounded by for question area sample input: M0011 XYZabcdefh #!C:/perl/bin -w die "Usage perl qup.pl " unless @ARGV ==