Can you try
if ( $projet =~ /^([EMAIL PROTECTED])@/ ) {
$provb = $1
}
You will collect all characters from the beginnning to the first '@'.
If The first character is a '@' you will obtain an empty string.
If the first character is a '@' and you want to exclude this case use
'^([EMAIL PROTECTED])@ to obtain a result only if there is at least one character
before the first '@'.
Sayed, Irfan (Irfan) a écrit :
Hi All,
I have one string aic_8.0@/vobs/pvob_aic which is stored in one variable
$project
Now I need only that part of that string which is before @ so I have
written following regular expression to achieve this...
my ($pvob) = ($project =~ m{(.+)@}); and with the help of this reg. exp.
I am achieving the expected result as aic_8.0
but my doubt is that how Perl knows that it has to stop collecting all
the characters till @ character comes and don't include @ character in
output
Please help.
Regards
Irfan.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/