0

I try to create a value using regex in java.

My email regex is : ^[\\w]([\\w\\-\\.\\+\\'\\/]*)@([\\w\\-\\.]*)(\\.[a-zA-Z]{2,22}(\\.[a-zA-Z]{2}){0,2})$ .

My regex genetor create 7@.-_-.fzLc this string.But i expected one proper emai.But it not created. So how to create proper meaningful value using regex in java

Obeth Samuel
  • 590
  • 1
  • 6
  • 18
  • 1
    Isn't that a perfectly valid email address? – Philipp Mar 09 '18 at 09:58
  • 1
    you will have to explain what "proper" means or nobody can help you – Tim Mar 09 '18 at 09:59
  • 1
    What are you ultimately trying to do with the address that you're generating? There's almost definitely a better way. – jsheeran Mar 09 '18 at 09:59
  • regex is not the best suited to generate values which this regex would match.Check this tool: https://www.browserling.com/tools/text-from-regex. email addresses are not random strings. Also your regex is far too simple: https://stackoverflow.com/questions/201323/how-to-validate-an-email-address-using-a-regular-expression – diginoise Mar 09 '18 at 10:28

0 Answers0