-----Original Message-----
From: Guthrie, Michael (GXS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 2:52 PM
To: 'Vitaly Sinitsin'
Cc: '[EMAIL PROTECTED]'
Subject: RE: regular expression questionIf you have a definitive list of delimiters as it appears you do, then grab all characters that are not in that list from the beginning of the string. I haven't tried this but it should work.
<--
$str = '[EMAIL PROTECTED];[EMAIL PROTECTED]';
if($str =~ /^([^\;\,\s\-\_]+)/) {
$email = $1;
}
Regards,
Mike
-----Original Message-----
From: Vitaly Sinitsin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 9:42 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: regular expression question
forget to mention: ';' isn't a delimiter, the idea is to get the first
email only! even if there are more. And emails can be separated by the
following signs only:
';' ',' '(' ')' 'white space' '-' '_'-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, October 02, 2002 2:32 PM
To: Vitaly Sinitsin; [EMAIL PROTECTED]
Subject: RE: regular expression question
Hi,
This script works
<--
for ('"[EMAIL PROTECTED];[EMAIL PROTECTED]')
{
/^(.*);(.*)$/;
print $1 . "\n";
}
-->Another way could be
<--
@array = split /;/, '"[EMAIL PROTECTED];[EMAIL PROTECTED]';
print $array[0];
-->And so many other...
Olivier Gerault
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Title: RE: regular expression question
nice
point,
but
what if email address includes '-' or '_' , meaning one of
separators?
- RE: Regular expression question Mohammed Khatib
- regular expression question Vitaly Sinitsin
- RE: regular expression question Olivier . Gerault
- RE: regular expression question Vitaly Sinitsin
- Re: regular expression question $Bill Luebkert
- RE: regular expression question Vitaly Sinitsin
- RE: regular expression question Olivier . Gerault
- RE: regular expression question DESFOSSES Marc \(Net log\)
- RE: regular expression question intertwingled
- RE: regular expression question Guthrie, Michael \(GXS\)
- RE: regular expression question Vitaly Sinitsin
- RE: regular expression question Guthrie, Michael \(GXS\)
- RE: regular expression question Ben Mathews
- RE: regular expression question chengkai
- Re: Regular expression question $Bill Luebkert
