regex - Can anyone explain this regular expression to me in detail? -
i have regex here , need know if 100% omit bad email addresses not understand them need call on community experts.
the string follows:
^[_a-za-z0-9-]+(.[_a-za-z0-9-]+)*@[a-za-z0-9-]+(.[a-za-z0-9-]+)*(.[a-za-z]{2,3})$
thank in advance!
^[_a-za-z0-9-]+(.[_a-za-z0-9-]+)*@[a-za-z0-9-]+(.[a-za-z0-9-]+)*(.[a-za-z]{2,3})$
piece piece
^ start of string [_a-za-z0-9-]+ 1 or more characters of "_" (no quotes), letter (a-z, a-z), number (0-9), or "-" (no quotes) (.[_a-za-z0-9-]+)* 0 or more substrings of type .something, or .123, or .a123. substring must formed . , letter (same group of letters before). "." not valid. ".a" or ".1" or ".-" is.
(up until accept example my.name12
or my.name12.surname34
)
@ "@" (like max@something) [a-za-z0-9-]+ 1 or more characters same pattern before (.[a-za-z0-9-]+)* 0 or more substrings of type ".something"... before (.[a-za-z]{2,3}) "." (dot) , 2 or 3 letters (a-z or a-z) $ end of string
so have email address, can't have something.@somethingelse.ss
(no "dangling" dot before @
) or .something@somethingelse.ss
(no beginning dot). domain must start letter , can't have dot before first level domain (.com
/.uk
/??), no something@x..com
. first-level domain must have 2 or 3 letters (no numbers)
there error, .
(dot) must escaped, should \.
. depending on language, \
must escaped in string (so \\.
)
Comments
Post a Comment