Sunday, 15 June 2014

javascript - String Dot String (Mail without Domain) RegEx -


Really stuck on this simple regex. It needs to validate the string, which will be a match without "@ domain.xxx".

It must fulfill the following rules:

  • No string
  • A string (letter only) should end.
  • The two strings must be separated from a dot.
  • There should not be any numbers or symbols in the full string.

I was trying something like ... / ^ [az] + $ / ^ [.] + $ / [Az] + $ / I ... but not success

  / ^ [azza-z] + \. [AZA-Z] + $ /  

ASCII will work for letters.

Try International Letter (รครก etc) if you also want to allow

  / ^ [^ \ w \ d _] + \. [^ \ W \ d _] + $ /  

[^ \ w \ d _] means any letter which is a non-alphanumeric character Not a number, and not an underscore ".


No comments:

Post a Comment