• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Write a email address using regular expression?

 
gao zhixin
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me, for example: xxxx@xxx.xxx,I especially want to know how to express the "."?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to escape the dot, using a backslash:

\.

Of course, if you use this in a Java string, you need to also escape the backslash for java, so that it looks like

"\\."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic