Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4072400
Votes 441
Synopsis New I/O: Regular-expression API
Category java:classes_io
Reported Against 1.1 , 1.3 , 1.1.1 , 1.1.4 , 1.1.5 , 1.1.6 , 1.2.2 , 1.2rc1 , 1.2beta2 , 1.2beta3 , 1.0alpha3 , 1.0prebeta1 , merlin-beta
Release Fixed 1.4(merlin-beta)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 1215091 , 1224663 , 4022549 , 4214757 , 4313885 , 4466004
Submit Date 16-AUG-1997
Description
The Java platform should provide a regular expression API
for use in text processing.

This API is being developed as part of the New I/O APIs
under JSR-051.
Work Around
N/A
Evaluation
Must do.

  xxxxx@xxxxx   1997-11-08

We need to have an extended regular expression package that supports both Perl 5 syntax and (?basic?) Unicode characters.

  xxxxx@xxxxx   1999-08-20
Comments
  
  Include a link with my name & email   

Submitted On 22-OCT-1997
ramayer
IMHO http://www.oroinc.com/products/PerlTools.html
has a nice (concise and relatively feature rich) 
interface for regexps.
It'd be nice if the official Java one is as concise.


Submitted On 10-DEC-1997
pshields
regular expressions and text-based object serialization/
deserialization in XML would beget distributed applications
with amazing interoperability. we need these in the core.


Submitted On 03-SEP-1998
guild
oroinc and Daniel Savarese did an excellent job with their regex package.  
There's been regex classes in the sun.misc package, so it's under works 
yet without documentation nor in the supported API.  
No real mention from Sun as to the possible inclusion of these packages in the
future, if ever.
Didn't see it in the JDK 1.2 documentation.   


Submitted On 13-NOV-1998
mrkortek
I want to port a C based product to 100% Java but
it needs regex support. Speed is critical as well.
My servlet package will also require it for search
related functionality. Need this in the core.


Submitted On 13-NOV-1998
cmpichler
Fast regular expressions as part of the Java language
would be most valuable. Many existing PERL
applications could migrate easily to Java - and benefit.


Submitted On 05-DEC-1998
wsharlan
oroinc is no longer distributed
and breaks in 1.2.


Submitted On 16-JAN-1999
ramayer
http://www.oroinc.com/ is back up, and their web pages say it'll support 1.2
shortly.


Submitted On 22-FEB-1999
munityev
Regular expressions in Java would be really
helpful. I just want to add my vote to that.


Submitted On 10-APR-1999
WesBiggs
Check out gnu.regexp at http://www.cacas.org/java/gnu/regexp.
It supports multiple syntaxes including Perl 5, awk, emacs, etc.
It's free software, too (I'm the maintainer), and works with 1.0, 1.1 and 1.2.
I think Sun missed the boat on this one, but
that's just more incentive to use free software, right?


Submitted On 24-APR-1999
kenmcneil
I *highly* recommend using gnu.regexp until Sun
catches on to this (1-2 years maybe). As Wes Biggs
said here already you can find it at
http://www.cacas.org/java/gnu/regexp. gnu.regexp
follows a good object model that allows it to mix
seamlessly with the rest of your Java code. After
using this I now believe that integrating regular
expressions into the lexical structure of Java
would be a mistake.


Submitted On 07-MAY-1999
catsclaw
Best, I think, would be to have a set of
generic interfaces for regular expressions.  There
could be two separate parts -- one to compile an
expression into a standard format, and another
representing the engine that performs the search.
This way the grammar used can be separated from
the engine it gets executed on and programmers
can choose at runtime which type of engine would
be good for a particular search, or can let the 
system pick the best one.  This would be similar
to the way the Crypto API, where clients can 
request servers with as much detail as they care
to.


Submitted On 16-JUN-1999
jdcjdc
We need a java.regularexpr package that can
handle all the regular expression needs. That 
way we can avoid Perl and its somewhat weird
syntax.


Submitted On 17-JUN-1999
janicki
Here's the best Java Regex package I've seen.  It 
permits full use of Perl syntax, and many other
useful classes/features:
    http://www.javaregex.com/


Submitted On 29-JUN-1999
bakgerman
We absolutely need regular expressions as part of
the core JDK.  TCL, Perl, etc. support this, and
its useful for validating strings in XML as well.


Submitted On 24-JUL-1999
frangonzalez
As a Sun VAR to newspapers, lack of regular expression poses a great limitation
to the speed and ease of developing custom billing interfaces and general
system administration/database tools in Java.  Perl is currently far superior
for this application.


Submitted On 09-OCT-1999
DSCreat
Both gnu and ORO packages are good as long as it comes to writing Perl-like
code, but in Java we could do it even better if there was something like
"OO text patern matching package". What I mean by that is something
that does not rely on Perl regexp syntax, but provides extensible framework of
pattern matching classes (TextPattern-TextPatternMatcher pairs) that can be
used "recursively". I have some preliminary ideas how this framework
should look like - you can to contact me for the details ...
Anyway, I will try to make this framework myself under LGPL, and if somebody
wants to participate/take over, he is welcome.
As for the Perl regexp syntax - there can be a couple of utility classes that
compile regexp strings into a TextPattern tree.


Submitted On 29-OCT-1999
riandp
Sun built a good lightweight regular expression package that is bundled with
the Java Web Server. It is now also used by their NetBeans IDE (see
regexp.jar). Why don't they provide it as a standard package in JDK 1.3 (or as
an extension) ?
For more information about Java & Regular expression, have a look to an
excellent site from the Belgium User Group, at www.bejug.org.
Phil.


Submitted On 16-NOV-1999
dkf
You could always adapt the code from Tcl8.2 which supports
both Unicode and extended syntax.  And it isn't encumbered
by an awkward license, unlike other languages I could mention...


Submitted On 21-NOV-1999
kmiecf
The ORO, Inc. package mentioned earlier is an excellent implementation of
regular expressions. It is up-to-date and conforms to Java 1.2.2. If it wasn't
there, a lot of projects might not have been completed. It would be a real
bonus if Java had a standard regular expressions package so developers didn't
have to go rooting around to find a third-party implementation of such a basic
and necessary function.


Submitted On 29-NOV-1999
joerg.wassmer
Sun said, this is a "must do".
That was 08.11.1997!


Submitted On 20-JAN-2000
derbyshire16
I could do it... make a regexp package that is.


Submitted On 21-FEB-2000
duale
When the world moves to XML, the need for regular 
expression packages will dissipate.  They're actually being 
very forward thinking in their decision (up to this date) 
not to include one.

Think of it as a way to weak programmers from backwards 
thinking ways (regexp) to new, better methods (xml).


Submitted On 22-FEB-2000
necrotech
I disagree with the xml comment. I find that regular 
expressions are very useful when working with legacy 
systems. While newer technologies certainly can be 
implemented from scratch, sometimes this isn't practical. 
Regular expressions are arguably the best tool a programmer 
has when parsing text, and until I see something better, I 
won't be switching. That being said, I'd like to have a RE 
package included with the standard Java API.


Submitted On 18-MAR-2000
joerg.wassmer
I disagree with the XML comment, too.
XML is good for handling structured data - but think of
working with texts written in a spoken language (english,
german, japanese...). Example: XML gives you nothing if you 
want to search for particular data, especially if you want 
to do more than searching for an exact string match. In 
other words, XML has simply nothing to do which such jobs.

There are already java solutions for working with regexp, 
but I think they should be implemented in the JDK's.


Submitted On 30-MAR-2000
dkf
Those who advocate the use of XML instead of regexps miss
the point.  All too often, you need to handle data that
already exists, and mapping it all to XML won't work too
well if the data is messy (as is all too common!)  XML won't
save the world or wash whiter.  All it does is provide a way
of passing structures across a text-based heterogeneous
communication link.  REs provide for complex searching
capabilities - like searching a text for all occurences of a
set of words - that XML simply doesn't address.

Also, how are you supposed to convert that data /to/ XML in
the first place?  REs would make doing this sort of thing
far easier, and it makes little sense to exclude Java from
this application area!  :^)


Submitted On 21-APR-2000
CookieMonster
Absolutely agree with this RFE.  I regularly write scads of 
PERL using the OO extensions (See Conway, Damien, "Object 
Oriented Perl" http://www.manning.com/Conway/index.html) 
and would love to replace it with Java (where appropriate), 
but the showstopper is Java's poor text-handling 
capabilities -- especially regexes.  The ORO packaages are 
nice but I agree with the poster who pointed out that it 
doesn't really have the nice OO flavor of the Java core.


Submitted On 21-APR-2000
CookieMonster
Oh yeah, I forgot to mention -- Perl 5.6 (due RSN) adds 
support for Unicode.


Submitted On 30-APR-2000
clearink
http://jakarta.apache.org/regexp/

hey all, the Apache Jakarta Project recently released a 
100% Java regexp package done by Jonathan Locke under a 
BSD/Apache license. So, forget all those issues you had 
with GPL and/or commercial licenses and come and get it! If 
you don't like it, help us improve it! :-)

http://jakarta.apache.org/regexp/

-jon stevens



Submitted On 05-JUN-2000
mcherm
Something like http://jakarta.apache.org/regexp would do very nicely. Check it out. Use it. All it needs is 
the official imprint of Sun (or Javasoft, or whatever standards committee is officially in charge these days) 
and distribution with the standard JDK. DO THIS ONE!!


Submitted On 27-JUL-2000
alexrios
The Python implementation of regular expressions, is a 
better match than PERL's.

Python is more clear and verbose, just like Java.


Submitted On 08-AUG-2000
andrew_r_jackson
Even C++ standard lib has regex support. I'm quite 
surprised this was missed in the core Java API's.


Submitted On 10-SEP-2000
dlgould
Interestinly, people within Sun have build a regexp package
-- sunlabs.brazil.util.regexp.*


Submitted On 02-OCT-2000
mcherm
So why was this bug closed? Was there an annoucement I missed? A new 
Regular Expressions package? If anyone knows, please send me an email.


Submitted On 02-OCT-2000
tgs
So the bug is closed with a "non-public release".
How about telling us when the public release will be available?


Submitted On 29-NOV-2000
amikulz
I agree that this should go into the core libraries asap. 
Why not release it to the general public??


Submitted On 31-JAN-2001
fancellu
Apache also now run the oroinc regexp product.

Let's hope Sun talk to Apache and don't 
get into a "Not Invented Here" thing.



PLEASE NOTE: JDK6 is formerly known as Project Mustang