Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Write a email address using regular expression?  RSS feed

 
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
Boost this thread!