aspose file tools
The moose likes Java in General and the fly likes Java Regexp API Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Java Regexp API
 
Similar Threads
Regular expression to check for specific special characters (any repitition) and 0 to 9 numbers
Locating data via pattern matching
Doubt in word boundaries
[regex] select word of 3 letter and more between other word
Regular expression to select # in words