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 Java Regexp API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Regexp API" Watch "Java Regexp API" New topic
Author

Java Regexp API

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
According to Oreilly Learning Java 2nd ed chap 9.6.1.7 (chap 10.7.1.7 for 3rd ed),


\w+@\w+(\.\w)+ // Match an email address

This expression matches a word, followed by an @ symbol, followed by another word and then one or more literal dot-separated words e.g., pat@pat.net, friend@foo.bar.com, or mate@foo.bar.co.uk.


However, I guess it should only match pat@pat.a.b.c.d, friend@foo.b.a.r.c, etc. Am I right?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes you are right. Must be a typo.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Regexp API