C. (
http://symcbean.blogspot.com/) wrote:
On 26 Aug, 10:53, virtuPIC <WebMas...@airspace-v.comwrote:
>On Aug 26, 9:09 am, Damodhar <damu...@gmail.comwrote:
>>you use the strstr function in php.
damuhttp://youropensource.com/
You can also use preg_match
virtuPIC
--
Airspace V - international hangar flying!http://www.airspace-v.com/ggadgetsfor tools & toys
You want an email address - but what do you mean by an email address?
us**@example.com
user.example.com.
"Some Guy" <us**@example.com>
hosta!hostb.edu!somewhere.else.com!example.com!use r
us**@example.com, ot***@example.com
"internal@accounts receivable"@example.com
CN=A User/OU=accounts/DC=com/DC=example
Each line above is a valid email address.
This might be what you are looking for:
/(\b)
[snip]
First off, you capture the word boundaries, which are zero-width
assertions, so will never match anything.
([a-z0-9\._%+!$&*=^|~#%'`?{}/\-]+
[snip]
Also, it's better to use the pre-defined character class \w, rather
than checking for [a-z0-9_] manually. \w is locale-specific, and may
match other valid characters. You also don't need to escape dots in
character classes.
@([a-z0-9\-]+\.){1,}([a-z]{2,6}))(\b)/i
You also use {1,} when the + quantifier would do.
@OP: Anyway, there are people who've made enormous regexes according
to the RFC, although it isn't always necessary to go to such lengths
to validate an email.
--
Curtis