Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #28386
| From | Dr J R Stockton <reply1500@merlyn.demon.co.uk.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Regular expression for email or mobile number in one field like facebook email/mobile field in registration |
| Date | 2015-07-13 23:13 +0100 |
| Organization | Home |
| Message-ID | <iBCwL1EmgDpVFwS2@invalid.uk.co.demon.merlyn.invalid> (permalink) |
| References | <9b0a260a-6988-469c-9f5a-aa738b847527@googlegroups.com> <55a2580f$0$1638$c3e8da3$5496439d@news.astraweb.com> |
In comp.lang.javascript message <55a2580f$0$1638$c3e8da3$5496439d@news.a
straweb.com>, Sun, 12 Jul 2015 22:05:36, Steven D'Aprano
<steve@pearwood.info> posted:
>On Sun, 12 Jul 2015 01:55 pm, ashokacharya1988@gmail.com wrote:
>
>>
>> Regular expression for email or mobile number in one field
>
>You *cannot* validate email addresses with a regular expression. If you try,
>you will just reject valid email addresses and accept invalid ones.
>
>The spec for valid email addresses is FORTY SEVEN pages long. And, even if
>you validate that the address is *syntactically* valid, you still have no
>idea whether it actually accepts mail or not. The only way to tell if an
>address is valid is to send email to it.
>
>I am sick and tired of websites that "helpfully" tell me that my email
>address, which I use to send and receive hundreds of emails every day, is
>not valid. If you try to validate an email address, STOP, you're doing it
>wrong.
>
>http://davidcel.is/posts/stop-validating-email-addresses-with-regex/
>
>http://www.mdswanson.com/blog/2013/10/14/how-not-to-validate-email-
>addresses.html
One cannot validate a mobile number fully with a RegExp either.
One can check for an attempted E-mail address. From memory, check for
yourself, all are of the form
something only-@ something dot something
and anything else _must_ be wrong.
--
(c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Regular expression for email or mobile number in one field like facebook email/mobile field in registration ashokacharya1988@gmail.com - 2015-07-11 20:55 -0700
Re: Regular expression for email or mobile number in one field like facebook email/mobile field in registration "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-07-12 11:07 +0200
Re: Regular expression for email or mobile number in one field like facebook email/mobile field in registration Steven D'Aprano <steve@pearwood.info> - 2015-07-12 22:05 +1000
Re: Regular expression for email or mobile number in one field like facebook email/mobile field in registration Dr J R Stockton <reply1500@merlyn.demon.co.uk.invalid> - 2015-07-13 23:13 +0100
Re: Regular expression for email or mobile number in one field like facebook email/mobile field in registration Steven D'Aprano <steve@pearwood.info> - 2015-07-14 12:47 +1000
Re: Regular expression for email or mobile number in one field like facebook email/mobile field in registration Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-07-13 16:50 -0300
Re: Regular expression for email or mobile number in one field like facebook email/mobile field in registration Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 16:38 +0200
csiph-web