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

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