regex - Regular Expression for email subdomain match -
Does anyone detect regular expressions that match those emails in which they contain a sub-domain?
For example,
name@subdomain.domain.com
or name@subdomain.domain.edu .au
preferably to use.
I tried to do this:
^ [- +. 0-9A-Z-AZ] + @ [- + 0-9A-ZAED] + \. [E-za-z] {2,4} $
but it also matches name @ Test.org
.
Do not do anyway for recognition purposes. It will only end in pain.
The only appropriate regular expression to validate an email address that searches for "@" sign and at least one period. Nothing; Even the arrival of alphanumerics does not make any sense.
At the minimum, you need to really define "subdomain". Everything subdomain is a subdomain? What is included and what is included in it?
How do you define "subdomain" by making "top level"? Do you mean "a subdomain"? "Subdomain of a subdomain of a domain that is open for public registration"? At what level of the delegation does it become a subdomain for your purposes?
Regarding the official domain, where "public" which can register the domain is very limited, and the rule of subdomain-of-subdomain is ideal? What do you want to match?
How will you cope with the fact that the list will change over time? Or with the addition of CCTLD / Removal? If CCTL changes its policy, then instead of selling only specific sub-registrars (for example "myname.org.au"), rather than direct descendant domains (eg "do you dynamically update your regex , And if so, how would you handle the valid address address and no longer remain, or vice versa?
I run a stupid email verification system which is my main email address ringerc @ ringerc. Id.au (as long as it's already 'nat' There is no issue till then) despite being a fully valid .id.au domain.
Please make another if your intention is not valid, it is good, but Please do not try to validate the e-mail address domain with a regex.
Comments
Post a Comment