Regex help for email
12 Message(s) by 5 Author(s) originally posted in php programming
| From: gezerpunta |
Date: Thursday, October 18, 2007
|
Hi
I need a
regex code for
parsing this
string to an email array
"mnp test"
<celo@xxxxxxxxxxx>,"test testt"
<otur@xxxxxxxxxxx>,sett@xxxxxxxxxxx,test@xxxxxxxxxxx
thanks
| From: ZeldorBlat |
Date: Thursday, October 18, 2007
|
wrote in
message :
Hi
I need a regex code for parsing this string to an email array
"mnp test" <c...@xxxxxxxxxxx>,"test testt"
<o...@xxxxxxxxxxx>,s...@xxxxxxxxxxx,t...@xxxxxxxxxxx
thanks
Why do you need a regex? Why not just use explode?
<http://www.php.net/explode>
| From: AnrDaemon |
Date: Sunday, October 21, 2007
|
Greetings, gezerpunta.
In
reply to Your message dated Thursday, October 18, 2007, 18:59:31,
g> I need a regex code for parsing this string to an email array
g> "mnp test"
<celo@xxxxxxxxxxx>,"test testt"
g>
<otur@xxxxxxxxxxx>,sett@xxxxxxxxxxx,test@xxxxxxxxxxx
Something like
<?php
$s = '"mnp test" <celo@xxxxxxxxxxx>,"test testt"
<otur@xxxxxxxxxxx>, sett@xxxxxxxxxxx,test@xxxxxxxxxxx';
if(preg_match_all('#[\s\,]
<?([0-9A-Za-z\_]+(?:[\-\.][0-9A-Za-z\_]+)*\@xxxxxxxxxxx[0-9A-Za-z]+(?:[\.\-\_][0-9A-Za-z]+)+)>?#xi', $s, $ta))
{
var_export($ta[1]);
}
?>--
Sincerely Yours, AnrDaemon
<anrdaemon@xxxxxxxxxxx>
| From: AnrDaemon |
Date: Sunday, October 21, 2007
|
Greetings, gezerpunta.
In reply to Your message dated Thursday, October 18, 2007, 18:59:31,
<?php
$s = 'celo@xxxxxxxxxxx, "mnp test" <celo@xxxxxxxxxxx>,"test testt" <otur@xxxxxxxxxxx>, sett@xxxxxxxxxxx,test@xxxxxxxxxxx';
if(preg_match_all('#(?:^|[\s\,])<?([0-9A-Za-z\_]+(?:[\-\.][0-9A-Za-z\_]+)*\@xxxxxxxxxxx[0-9A-Za-z]+(?:[\.\-\_][0-9A-Za-z]+)+)>?#xi', $s, $ta))
{
var_export($ta[1]);
}
?>--
Sincerely Yours, AnrDaemon <anrdaemon@xxxxxxxxxxx>
| From: Steve |
Date: Monday, October 22, 2007
|
Greetings, gezerpunta.
In reply to Your message dated Thursday, October 18, 2007, 18:59:31,
<?php
$s = 'celo@xxxxxxxxxxx, "mnp test" <celo@xxxxxxxxxxx>,"test testt" <otur@xxxxxxxxxxx>,
sett@xxxxxxxxxxx,test@xxxxxxxxxxx';
if(preg_match_all('#(?:^|[\s\,])<?([0-9A-Za-z\_]+(?:[\-\.][0-9A-Za-z\_]+)*\@xxxxxxxxxxx[0-9A-Za-z]+(?:[\.\-\_][0-9A-Za-z]+)+)>?#xi',
$s, $ta))
{
var_export($ta[1]);
}
of course you'd. however, notice that whatever your prowess at regex,
you lack understanding of the basic email conventions explained in the
rfc(s). your preg does not allow for
atomic account names. ;^)
hmmmm...this *does* (and then some).
function isEmail($email)
{
if (!$email){ return false; }
$pattern =
"/^((\"[^\"]*?\")|([^\(\)\
<\>\@xxxxxxxxxxx\,\;\:\\\"\[\]\s\*\/]+))@xxxxxxxxxxx(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$/si";
return preg_match($pattern, $email);
}
the pattern above simply needs to be applied to the entire string, and you
get what you want.
| From: Steve |
Date: Wednesday, October 24, 2007
|
Greetings, Steve.
In reply to Your message dated Monday, October 22, 2007, 20:53:00,
Greetings, gezerpunta.
In reply to Your message dated Thursday, October 18, 2007, 18:59:31,
<?php
$s = 'celo@xxxxxxxxxxx, "mnp test" <celo@xxxxxxxxxxx>,"test testt"
<otur@xxxxxxxxxxx>,
sett@xxxxxxxxxxx,test@xxxxxxxxxxx';
if(preg_match_all('#(?:^|[\s\,])<?([0-9A-Za-z\_]+(?:[\-\.][0-9A-Za-z\_]+)*\@xxxxxxxxxxx[0-9A-Za-z]+(?:[\.\-\_][0-9A-Za-z]+)+)>?#xi',
$s, $ta))
{
var_export($ta[1]);
}
S> of course you'd. however, notice that whatever your prowess at
regex,
S> you lack understanding of the basic email conventions explained in the
S> rfc(s). your preg does not allow for atomic account names. ;^)
Example please?
read the freaking email rfc(s).
What You mean "atomic account names"?
hmmmm, what do you think?
the rfc's allow for 'illegal'
character s in account names as long as they're
encapsulated. this is to compensate for non-latin character sets
(particularly, non-english sets). is that ringing a bell?
| From: Steve |
Date: Thursday, October 25, 2007
|
Greetings, Steve.
In reply to Your message dated Wednesday, October 24, 2007, 21:34:41,
<?php
$s = 'celo@xxxxxxxxxxx, "mnp test" <celo@xxxxxxxxxxx>,"test testt"
<otur@xxxxxxxxxxx>,
sett@xxxxxxxxxxx,test@xxxxxxxxxxx';
if(preg_match_all('#(?:^|[\s\,])<?([0-9A-Za-z\_]+(?:[\-\.][0-9A-Za-z\_]+)*\@xxxxxxxxxxx[0-9A-Za-z]+(?:[\.\-\_][0-9A-Za-z]+)+)>?#xi',
$s, $ta))
{
var_export($ta[1]);
}
S> of course you'd. however, notice that whatever your prowess at
regex,
S> you lack understanding of the basic email conventions explained in
the
S> rfc(s). your preg does not allow for atomic account names. ;^)
Example please?
S> read the freaking email rfc(s).
Do it for me, please.
WTF?!!! I read it for me...and those that pay me. you may continue to be
lazy at your liesure.
What You mean "atomic account names"?
S> hmmmm, what do you think?
S> the rfc's allow for 'illegal' characters in account names as long as
they're
S> encapsulated. this is to compensate for non-latin character sets
S> (particularly, non-english sets). is that ringing a bell?
Never saw any in 10 years.
and you speak english and
type with a 'normal' keyboard. now, for the
chinese, japanese, etc. people out there...well, you should get the point.
hell, even this plain english account is valid:
"oops, there's spaces and commas and shit"@xxxxxxxxxxx
get the picture, cupcake?
And I think I will never see.
good for you. glad you feel that way. that does not change the fact that
email rfc standards define and allow for it.
Not all what allowed by RFC is acceptable by real ISP 's.
uhmmmm...'real' isp? hmmmm, what'd a 'fake' isp look like I wonder?
maybe like the sprint commercials where 'the other guy's network' is a bunch
of propped up pictures of people. can you hear me now? ROFLMAO!
ok, nimrod...why not quantify and qualify that statement so no one here
thinks you're just talking outta your ass.
which isp doesn't
support which rfc standard(s)?
since you have not even READ ONE SINGLE email rfc, I doubt you can back
yourself up...save, to backpeddle.
Typical rules I see around the world:
(?i)^[a-z][0-9a-z]*(?:[\.\-\_][0-9a-z]+)*$
that's because you're viewing the world through your ass. RTFM.
Sincerely Yours,
i do not want you...unless returning you means I can get a refund!
run along now.
| From: Michael Fesser |
Date: Thursday, October 25, 2007
|
.oO(AnrDaemon)
Greetings, Steve.
In reply to Your message dated Wednesday, October 24, 2007, 21:34:41,
S> the rfc's allow for 'illegal' characters in account names as long as they're
S> encapsulated. this is to compensate for non-latin character sets
S> (particularly, non-english sets). is that ringing a bell?
Never saw any in 10 years. And I think I will never see.
Not all what allowed by RFC is acceptable by real ISP's.
It's also not acceptable to improperly mark quoted lines in a reply,
because it makes the postings very hard to read. The
Usenet way is a
single '>', so please adjust your newsreader. I think I have already
mentioned that.
Micha
| From: Steve |
Date: Thursday, October 25, 2007
|
.oO(AnrDaemon)
Greetings, Steve.
In reply to Your message dated Wednesday, October 24, 2007, 21:34:41,
S> the rfc's allow for 'illegal' characters in account names as long as
they're
S> encapsulated. this is to compensate for non-latin character sets
S> (particularly, non-english sets). is that ringing a bell?
Never saw any in 10 years. And I think I will never see.
Not all what allowed by RFC is acceptable by real ISP's.
It's also not acceptable to improperly mark quoted lines in a reply,
because it makes the postings very hard to read. The Usenet way is a
single '>', so please adjust your newsreader. I think I have already
mentioned that.
i have been biting my tongue on that one so I could stay on topic with the
regex. thanks for pointing that out.
cheers.
| From: Michael Fesser |
Date: Thursday, October 25, 2007
|
.oO(Steve)
wrote in message
It's also not acceptable to improperly mark quoted lines in a reply,
because it makes the postings very hard to read. The Usenet way is a
single '>', so please adjust your newsreader. I think I have already
mentioned that.
i have been biting my tongue on that one so I could stay on topic with the
regex. thanks for pointing that out.
I've bitten my tongue too often. ;-)
Micha
| From: Steve |
Date: Thursday, October 25, 2007
|
.oO(Steve)
wrote in message
It's also not acceptable to improperly mark quoted lines in a reply,
because it makes the postings very hard to read. The Usenet way is a
single '>', so please adjust your newsreader. I think I have already
mentioned that.
i have been biting my tongue on that one so I could stay on topic with the
regex. thanks for pointing that out.
I have bitten my tongue too often. ;-)
i actually used to use a non-standard
delimiter b/c it made things more
readable in my newsreader. after you quite nicely asked if i'd change it for
the benefit of all, we've the end result.
I think you can give yourself a
break on this
subject - your tongue anyway.
:)
| From: Michael Fesser |
Date: Thursday, October 25, 2007
|
.oO(Steve)
wrote in message
I have bitten my tongue too often. ;-)
I actually used to use a non-standard delimiter b/c it made things more
readable in my newsreader. after you quite nicely asked if i'd change it for
the benefit of all, we've the end result.
I can remember.
i think you can give yourself a break on this subject - your tongue anyway.
;-)
I know about different kinds of delimiters. Some are quite common in
chatrooms and I have also used some of them years ago, but today most
newsreaders are programmed for '>' at the beginning of a line. That's
what makes a quote, like '-- ' makes a signature. It's just a common,
non-written standard, that helps to make Usenet a better place.
But this is _really_ OT here, so EOT.
Micha
Next Message: include ('url') VS readfile('url')
Blogs related to Regex help for email
Flash
... flash recent spear flash kombat mortal movie flash hilton paris pussy canon flash s3 8 flash professional tutorial flash
email marketing flash grandmaster message free downloadable flash game book flash guest
php tutorial flash free
...
Respect can only be earned and not acirc asked for acirc.
low interest credit cards for bankruptcy filers sportsbook with american express credit card bank of america business hours auto parts la paz
email virus
php php email virus web hosting reseller account maryland bankruptcy recordsbox 0
...
We called them on the radio, in english, no response.
top 1000 banks bad credit auto loan refinance air canada flight schedule may 14 2007 scream at the beach bmw motorcycle part accessory accounting business canada small software
php how to use outlook exress with aol
email account
...
Flash
... 6 adobe download flash player atlanta flash designer canon flash sigma celtic tattoo flash art new sex flash game beach flash kingston 1 gb flash drive animation creation flash
gex designer flash site web drive flash partition usb
...
Flash
... disney flash 1gb compact flash flash kicker video christmas flash tree standalone flash player making flash cartoon click flash free game point scary flash download flash free menu animation creation flash
gex flash sound effects
...
Flash
... sexy funny flash animation creation flash
gex flash game horse online racing 8 flash free player 2gb card digital flash memory sandisk secure flash macromedia player.com anatomy barrons card flash flash disposable camera animation
...