wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Regular Expressions, Where are they? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Regular Expressions, Where are they?" Watch "Regular Expressions, Where are they?" New topic
Author

Regular Expressions, Where are they?

Warren Bell
Ranch Hand

Joined: Dec 20, 2000
Posts: 56
Are there any regular expression capabilities in Java. I am looking for a simple way to replace text in a string. For example, replace every word that starts with "a" and ends in "a" with the word "replaced". The String and String Buffer classes can do this, but not without a lot of work.
Thanks,
------------------
Warren Bell


Warren Bell
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Warren,
If you can work on JDK1.4 beta, you can look into java.util.regex class. See this excellent article.
-Peter
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Another good regex package is the Jakarta Regexp package. That's what we use for now, since JDK 1.4 Beta is too bleedy edge.
-Peter
Ivan Tamayo
Ranch Hand

Joined: Aug 13, 2001
Posts: 49
Handle of regular expression comes with Java SDK 1.4. �The Java CookBook includes examples on this?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regular Expressions, Where are they?