Regular Expression package for Java.

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

I need to choose a java package to handle regular expressions.
I am aware of:
-jakarta regexp:
-jakarta 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

    The first choice is powerful enough! Read the javadoc!

    LVL 24

    Expert Comment

    If you don't have the full documentation yet, download it at:;jsessionid=EB9A200388A4D51AAA8C6AEBB192F52D

    and read the topic of Class Pattern.

    I think you can live with that!


    Author Comment

    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?
    LVL 19

    Accepted Solution

    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
    LVL 2

    Expert Comment

    > 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

    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

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Java 1603 Error 2 27
    wordsFront challenge 8 48
    bigHeights  challenge 13 43
    Java Message handling in Service Layer 3 22
    Do you hate spam? I do, and I am willing to bet you do as well. I often wonder, though, "if people hate spam so much, why do they still post their email addresses on the web?" I'm not talking about a plain-text posting here. I am referring to the fa…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now