Regular Expression package for Java.

Posted on 2007-07-22
Medium Priority
Last Modified: 2008-03-06

I need to choose a java package to handle regular expressions.
I am aware of:
-java.util.regex: http://java.sun.com/docs/books/tutorial/essential/regex/index.html
-jakarta regexp: http://jakarta.apache.org/regexp
-jakarta ORO: http://jakarta.apache.org/oro/

java.util.regex seems to be not powerful enough, and  jakarta regexp and ORO seem to be a dead projects.

Can you please tell me if there is a better package, and what are the advantages and disadvantages of each one? (just copying the description of their respective websites is not a useful answer)

DAvid Portabella
Question by:dportabella
LVL 24

Expert Comment

ID: 19542229
The first choice is powerful enough! Read the javadoc!

LVL 24

Expert Comment

ID: 19542235
If you don't have the full documentation yet, download it at:


and read the topic of Class Pattern.

I think you can live with that!


Author Comment

ID: 19542245
Sage, this answer is not informative enough.
I need to rationally justify the decision (whichever it is).

Do you know what are the difference between each of these packages?
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 19

Accepted Solution

Jim Cakalic earned 375 total points
ID: 19542743
Here is a link to a sample chapter from the O'Reilly book "Mastering Regular Expressions". The chapter just happens to be a comparison of several (7 in fact) Java APIs including those that you have mentioned. The time of the writing is pre-Java 1.4.2 so some of the information may have changed.

Jim Cakalic

Expert Comment

ID: 19546052
> java.util.regex seems to be not powerful enough

Can you please elaborate? There are things regular expressions can't do but the JDK implementation is just about as powerful as any.
LVL 24

Expert Comment

ID: 19546393
I can only say: keep to the standard by SUN.
In fact SUN's implementation is the certified release of the Jakarta versions.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question