Re: script to match a valid email id

2014-07-11 Thread Gunnar Hjalmarsson
On 2014-07-10 20:30, Sunita Pradhan wrote: > I want to write a script which will verify a valid email address . > Could anybody give some ideas , how to write a pattern for this ? Almost 10 years ago I posted this: http://www.mail-archive.com/beginners%40perl.org/msg62681.html Probably that funct

Re: script to match a valid email id

2014-07-11 Thread David Precious
On Fri, 11 Jul 2014 10:20:10 +0300 Yosef Levy wrote: > 2014-07-10 21:30 GMT+03:00 Sunita Pradhan > : > > > I want to write a script which will verify a valid email address . > > Could anybody give some ideas , how to write a pattern for this ? > \b[\w\.-]+@[\w\.-]+\.\w{2,4}\b > This was taken fr

Re: script to match a valid email id

2014-07-11 Thread Yosef Levy
\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b This was taken from: http://www.regexr.com/ 2014-07-10 21:30 GMT+03:00 Sunita Pradhan : > I want to write a script which will verify a valid email address . > Could anybody give some ideas , how to write a pattern for this ? > > -Sunita >

Re: script to match a valid email id

2014-07-10 Thread David Precious
On Thu, 10 Jul 2014 11:54:07 -0700 Bob goolsby wrote: > Nota Bene: > xxx@zzz.www IS NOT the only valid format for an email > address In this case, you really need to rethink your objection > to using the proper CPAN module *This*. Use the well-trusted, battle-tested CPAN module. Whate

Re: script to match a valid email id

2014-07-10 Thread Mike
That's a lot of regex. On 7/10/14, 2:25 PM, Ron Bergin wrote: Sunita Pradhan wrote: I do not want to use Cpan modules . -Sunita What do you have against using a cpan module? If you don't want to use the module, then why not simply copy/use the regex that it uses to do the validation? $RFC8

RE: script to match a valid email id

2014-07-10 Thread Ron Bergin
Sunita Pradhan wrote: > I do not want to use Cpan modules . > > -Sunita > What do you have against using a cpan module? If you don't want to use the module, then why not simply copy/use the regex that it uses to do the validation? $RFC822PAT = <<'EOF'; [\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:

Re: script to match a valid email id

2014-07-10 Thread Розанда ЧУП
:33:24 -0700 >> Subject: Re: script to match a valid email id >> From: r...@i.frys.com >> To: sunita.pradhan.2...@hotmail.com >> CC: beginners@perl.org >> >> Sunita Pradhan wrote: >> > I want to write a script which will verify a valid e

Re: script to match a valid email id

2014-07-10 Thread Розанда ЧУП
use the regular expression for checking @ and dot and length of some address' parts:) for example, try this: #!/usr/bin/perl use warnings; use strict; use 5.014; print "enter the email address "; while (<>) { if(/\A.{4,15}\@.+?\..{2,3}\Z/) { print "it's correct\n"; }

Re: script to match a valid email id

2014-07-10 Thread Andy Bach
On Thu, Jul 10, 2014 at 1:42 PM, Sunita Pradhan < sunita.pradhan.2...@hotmail.com> wrote: > I do not want to use Cpan modules . > Depending upon how "correct" you want to be, it's not easy: http://stackoverflow.com/questions/210945/what-would-be-a-globally-accepted-regular-expression-to-match-e-

Re: script to match a valid email id

2014-07-10 Thread Bob goolsby
t; > Subject: Re: script to match a valid email id > > From: r...@i.frys.com > > To: sunita.pradhan.2...@hotmail.com > > CC: beginners@perl.org > > > > > Sunita Pradhan wrote: > > > I want to write a script which will verify a valid email address

Re: script to match a valid email id

2014-07-10 Thread SSC_perl
On Jul 10, 2014, at 11:30 AM, Sunita Pradhan wrote: > I want to write a script which will verify a valid email address . > Could anybody give some ideas , how to write a pattern for this ? Sunita, I've used Email::Valid for this and it works nicely. And the code to use it is pretty easy

RE: script to match a valid email id

2014-07-10 Thread Sunita Pradhan
I do not want to use Cpan modules . -Sunita > Date: Thu, 10 Jul 2014 11:33:24 -0700 > Subject: Re: script to match a valid email id > From: r...@i.frys.com > To: sunita.pradhan.2...@hotmail.com > CC: beginners@perl.org > > Sunita Pradhan wrote: > > I want to write a

Re: script to match a valid email id

2014-07-10 Thread Ron Bergin
Sunita Pradhan wrote: > I want to write a script which will verify a valid email address . > Could anybody give some ideas , how to write a pattern for this ? > > -Sunita > Take a look at the Email::Valid module. http://search.cpan.org/~rjbs/Email-Valid-1.194/lib/Email/Valid.pm -- To unsubscrib