Regular expression package.

P

Prabh

Hi,
I cant use java.util.regex.* for my regexp processing, because the JRE
isnt upto 1.4.* yet.
I'm thinking of using the "jakarta-regexp-1.2.jar" and set it in my
CLASSPATH.

How different is this jar from the util.regex package?
Why did Jakarta release this jar when regexp capability is already
part of standard distro(atleast 1.4 onwards)?
Does the usage of these differ much?
I see, a whole lot of tutorials on Java Regex using
"import java.util.regex.*", not nearly enough
"import org.apache.oro.text.regex.*;"

Please point me in the right direction.

Thanks,
Prabh
 
S

S.A. Samokhodkin

Hi!
Prabh said:
Hi,
I cant use java.util.regex.* for my regexp processing, because the JRE
isnt upto 1.4.* yet.
I'm thinking of using the "jakarta-regexp-1.2.jar" and set it in my
CLASSPATH.

Look also at my JRegex ( http://jregex.sourceforge.net )
How different is this jar from the util.regex package?

It has less features. The first coming to mind are unicode, lookarounds,
class ariphmetics.. thread safety, too. Summing up, it's rather
primitive, as mentioned in the docs.
Why did Jakarta release this jar when regexp capability is already
part of standard distro(atleast 1.4 onwards)?

It's an old thing which had started in the times of JDK 1.0.
Does the usage of these differ much?
I see, a whole lot of tutorials on Java Regex using
"import java.util.regex.*", not nearly enough
"import org.apache.oro.text.regex.*;"

The first one already in the JDK, why to bother to introduce the 3-d
party library?
BTW, don't confuse the jakarta-regexp and jakarta-oro. They are
different, the second is better.
Please point me in the right direction.

See my first line.
 
A

antroy

Prabh said:
Hi,
I cant use java.util.regex.* for my regexp processing, because the JRE
isnt upto 1.4.* yet.
I'm thinking of using the "jakarta-regexp-1.2.jar" and set it in my
CLASSPATH.

I've not used this one. Take a look at the gnu.regexp package as well
(available from GNU of course). It's very good, and not too big. The
syntax for the regex's are (more or less) the same in both JSDK1.4+ and
gnu.regexp (gnu offers a variety of syntaxes including Perl 5, Sun's
version is based on Perl 5 with a few differences).

However the implementations are different, so if you decide to upgrade
to 1.4 and use the regexes in the standard library, you'll need to
change a few things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,471
Messages
2,571,823
Members
48,797
Latest member
PeterSimpson
Top