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
Sekhar, try this
my $string = '/install/sql/foo.c@@/main/integration/1';
$string =~ s/^.*\/(.*)[EMAIL PROTECTED]@.*/$1/;
print $string,"\n";
I took advantage of .* being greedy.
Regards,
Sam Dela Cruz
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
>
>
> e.g. /install/sql/f
Hi,
See comments below.
Chris McEwen
Sr. Configuration Management Analyst
Alcatel Canada Inc.
Office: 416.748.4424 ext 5015
mailto: [EMAIL PROTECTED]
sekhar kavuru <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
10/28/2005 11:51 AM
To
activeperl@listserv.ActiveState.com
cc
Subject
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