Thomas Adam
1/14/2008 12:09:00 AM
Hi --
On 13/01/2008, Johnathan Smith <stu_09@hotmail.com> wrote:
> hey
>
> im looking to write a regular expression for an email address
> however, i want the first part of the name to be initials (first initial
> and optional middle initial) and a surname
>
> such as
>
> j.m.smith@domain.com
>
> any help would be greatly appreciated
What is it you want to do with this?
a="j.m.smith@domain.com"
p "yes" if a.scan(/\w+\.(\w+\.)??(\w+)??\@(\w+)(.*)/).size > 0
And several other variations thereof.
-- Thomas Adam