Re: reg exp question

2009-07-15 Thread John W. Krahn
Lex Thoonen wrote: Hi, I'm trying to do this: in the original text is this: ((se-HomePage|Svenska)) I want to leave it at just: Svenska So I tried this: $row[3] =~ s|\(\(.*?\|(.*?)\)\)|$1|g; but somehow after substituting it now shows: ((se-HomePage|Svenska I don't get it. $ perl -le

Re: reg exp question

2009-07-15 Thread Steve Bertrand
Lex Thoonen wrote: > Hi, > > I'm trying to do this: > > in the original text is this: > > ((se-HomePage|Svenska)) > > I want to leave it at just: > > Svenska > > So I tried this: > > $row[3] =~ s|\(\(.*?\|(.*?)\)\)|$1|g; > > but somehow after substituting it now shows: > > ((se-HomePage|Sv

reg exp question

2009-07-15 Thread Lex Thoonen
Hi, I'm trying to do this: in the original text is this: ((se-HomePage|Svenska)) I want to leave it at just: Svenska So I tried this: $row[3] =~ s|\(\(.*?\|(.*?)\)\)|$1|g; but somehow after substituting it now shows: ((se-HomePage|Svenska I don't get it. Someone here? Thanks! -- Lex

Re: reg exp question

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Stuart Clark said: >How do I match a pattern that starts with a 4 and has 16 numbers in it. > >I try /^4\d{16}/; That's quite vague. Do you mean the string must start with a 4 and consist ONLY of 16 digits? /^4\d{15}$/ >Also how do I match a 16 digit number that starts with eith

Re: reg exp question

2002-02-07 Thread Frank
On Thu, Feb 07, 2002 at 12:17:42PM +, 'Perl wrote: > > /^(6565\d{12})|(555[10]00\d{10})/ > > Perhaps.. > > not tested mind. evidently.. /^(6565\d{12})|(555[10]\d{12})/ will manage numbers in the range 555000-555199, not ideal /^((6565\d{2})|(555(0\d{2})|(100))\d{10})/ will manage the

Re: reg exp question

2002-02-07 Thread Frank
On Thu, Feb 07, 2002 at 11:10:14PM +1100, Stuart wrote: > How do I match a pattern that starts with a 4 and has 16 numbers in it. > > I try /^4\d{16}/; If it consists of 16 numbers try: /^4\d{15}/; > Also how do I match a 16 digit number that starts with either 6565 or > starts with a number

reg exp question

2002-02-07 Thread Stuart Clark
How do I match a pattern that starts with a 4 and has 16 numbers in it. I try /^4\d{16}/; Also how do I match a 16 digit number that starts with either 6565 or starts with a number in the range of 555000-555100 /(^6565(\d{16})|^{555000-555100}(\d{16}))/

Re: quick reg. exp. question

2001-11-27 Thread Jenda Krynicky
From: "Quelance" <[EMAIL PROTECTED]> > replace any matched spaces with   > replace a new line with > > > while() { > s/\s/ /; #replace spaces with   > s/\n/\n/; #replace newlines with > print $_; > print

Re: quick reg. exp. question

2001-11-26 Thread Jeff 'japhy' Pinyan
On Nov 26, Quelance said: >replace any matched spaces with   >replace a new line with Um, newline is a space. >while() { > s/\s/ /; #replace spaces with   > s/\n/\n/; #replace newlines with > print $_; > print OUTFILE $_; >} You probably want to change s/\s/ / to s/[ \t]/ /g. That do

quick reg. exp. question

2001-11-26 Thread Quelance
I've been avoiding regular expression for quite some time because they are eVil but I have no choice anymore :) Ok, as a warm up script I'm trying to get this working: replace any matched spaces with   replace a new line with while() { s/\s/ /; #replace spaces with