File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to Write a email address using regular expression? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to Write a email address using regular expression?" Watch "How to Write a email address using regular expression?" New topic
Author

How to Write a email address using regular expression?

gao zhixin
Ranch Hand

Joined: Jan 18, 2006
Posts: 42
Please help me, for example: xxxx@xxx.xxx,I especially want to know how to express the "."?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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

"\\."


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Write a email address using regular expression?
 
Similar Threads
Clock problem
thanks!!! another SCJP born~
Ant and Cactus - classpath issues
http-method not specified
Args in Netbeans