Re: Help with regex

2009-08-13 Thread Bill Luebkert
deane.rothenma...@walgreens.com wrote: > > Cheap and dirty, cheezy, kindergarteny, but it does what you want: > > use strict; > use warnings; > > my $phnum = '847-VICTORY'; > > print "before: \"$phnum\"\n"; > > $phnum =~ s/[ABC]/2/ig; > $phnum =~ s/[DEF]/3/ig; > $phnum =~ s/[GHI]/4/ig; > $phnu

Re: Help with regex

2009-08-13 Thread Deane . Rothenmaier
Cheap and dirty, cheezy, kindergarteny, but it does what you want: use strict; use warnings; my $phnum = '847-VICTORY'; print "before: \"$phnum\"\n"; $phnum =~ s/[ABC]/2/ig; $phnum =~ s/[DEF]/3/ig; $phnum =~ s/[GHI]/4/ig; $phnum =~ s/[JKL]/5/ig; $phnum =~ s/[MNO]/6/ig; $phnum =~ s/[PQRS]/7/ig;

Re: Help with regex

2009-08-13 Thread anthony . okusanya
sanya From: "Stanislaw Romanski" To: "Barry Brevik" , Date: 08/13/2009 12:20 PM Subject: Re: Help with regex Sent by: activeperl-boun...@listserv.activestate.com Hello, Maybe you need something like $text =~ tr/ABCD/2223/; ? Stanislaw Romanski - Original Mess

Re: Help with regex

2009-08-13 Thread Stanislaw Romanski
Hello, Maybe you need something like $text =~ tr/ABCD/2223/; ? Stanislaw Romanski - Original Message - From: "Barry Brevik" To: Sent: Thursday, August 13, 2009 6:52 PM Subject: Help with regex >I am using Active Perl 5.8.8. and Perl Dev Kit 7.0. > > I&

Help with regex

2009-08-13 Thread Barry Brevik
I am using Active Perl 5.8.8. and Perl Dev Kit 7.0. I'm writing some code that standardizes the format of phone numbers in a database because users have entered them in every way imaginable. Anyway, some of the phone numbers look like this: 800-69-VORTEX ...where the user has entered alpha

Re: Need help with regex

2005-10-28 Thread Petr Vileta
sekhar kavuru wrote: Hi All I need a REGEX to get a string between two characters from a static string e.g. /install/sql/foo.c@@/main/integration/1 I need to get foo.c , i.e string between / and @@ my $string = '/install/sql/foo.c@@/main/integration/1'; $string =~ s#^.+?(.*?/([^/]+?))[EMAI

Re: Need help with regex

2005-10-28 Thread Sam Dela Cruz
** Sam Dela Cruz sekhar kavuru <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 10/28/2005 08:51 AM To activeperl@listserv.ActiveState.com cc Subject Need help with regex Classification Hi All   I need a REGEX to get a string between two characters from a stat

RE: Need help with regex

2005-10-28 Thread Brian Raven
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sekhar kavuru Sent: 28 October 2005 16:51 To: activeperl@listserv.ActiveState.com Subject: Need help with regex > Hi All > > > I need a REGEX to get a string between two characters from a static string > > &

Re: Need help with regex

2005-10-28 Thread Chris . McEwen
ubject Need help with regex Hi All   I need a REGEX to get a string between two characters from a static string   e.g. /install/sql/foo.c@@/main/integration/1   I need to get foo.c , i.e string between / and  @@     First it needs find where @@ occurs in the string and trace back to fil

RE: Need help with regex

2005-10-28 Thread Bullock, Howard A.
use strict; my $text = '/install/sql/foo.c@@/main/integration/1'; my ($value) = $text =~ /\/([^\/]+?)@/; e.g. /install/sql/foo.c@@/main/integration/1 ___ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.Active

Need help with regex

2005-10-28 Thread sekhar kavuru
Hi All   I need a REGEX to get a string between two characters from a static string   e.g. /install/sql/foo.c@@/main/integration/1   I need to get foo.c , i.e string between / and  @@    First it needs find where @@ occurs in the string and trace back to file name until it encounters / character