Re: backreference question

2002-03-14 Thread John W. Krahn
Jess Balint wrote: > > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > > > > M Z wrote: > > > > > > I was wondering if someone could point me in the right > > > direction for the following regex. > > > > > > s/(.{1,100}(?: |(\-))/$1$2\n/g; > > > > > > Please help on the second (?: |\-) > > > I

RE: backreference question

2002-03-14 Thread Jeff 'japhy' Pinyan
On Mar 14, Balint, Jess said: >What exactly does this ($2 eq '-' && $2) do? Must it be in parenthesis? Try it. It is "technically" the same as: if ($2 eq '-') { $2 } Used in the context of: >s/(.{1,100})( |-)/$1 . ($2 eq '-' && $2) . "\n"/eg; Here is an example: $x = "foo"; $y = $x e

RE: backreference question

2002-03-14 Thread Balint, Jess
What exactly does this ($2 eq '-' && $2) do? Must it be in parenthesis? -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 6:40 PM To: [EMAIL PROTECTED] Subject: Re: backreference question M Z wrote: > > Hello Hell

Re: backreference question

2002-03-12 Thread John W. Krahn
M Z wrote: > > Hello Hello, > I was wondering if someone could point me in the right > direction for the following regex. > > s/(.{1,100}(?: |(\-))/$1$2\n/g; > > Please help on the second (?: |\-) > I am trying to match either a single space ' ' > or a - after 100 other characters and I want

RE: backreference question

2002-03-12 Thread Nikola Janceski
, March 12, 2002 3:20 PM To: [EMAIL PROTECTED] Subject: backreference question Hello I was wondering if someone could point me in the right direction for the following regex. s/(.{1,100}(?: |(\-))/$1$2\n/g; Please help on the second (?: |\-) I am trying to match either a single space ' &

backreference question

2002-03-12 Thread M z
Hello I was wondering if someone could point me in the right direction for the following regex. s/(.{1,100}(?: |(\-))/$1$2\n/g; Please help on the second (?: |\-) I am trying to match either a single space ' ' or a - after 100 other characters and I want to save the - but not the ' ' thereby $2