I'm putting together a series of lessons on learning the java.util.regex package. Parts one and two have been through a round of critiquing with the moderators and are now ready to be critiqued further by any interested volunteers. If you are interested, email me at email@example.com and let me know.
Is there an easy way to install the 1.4 regexp package on top of a 1.3.1 JDK?
Ron Newman - SCJP 1.2 (100%, 7 August 2002)
posted 17 years ago
java.util.regex is part of the Java 1.4 API. You cannot just install this package on top of a Java 1.3 installation. If you want to use this package, you need to install the Java 2 SDK version 1.4. You could download and use one of the various free third party regular expression packages available. The regular expression syntax used with different packages may very.
The problem is that I have MacOS X, which supports only 1.3.1. Could I somehow get the source code for 1.4 regex, compile it, and patch it into my 1.3.1 jar files? Or are there native methods involved, which would make this impossible? [ August 27, 2002: Message edited by: Ron Newman ]
I think this may work actually; I don't think there are any native methods, or significant dependancies on other 1.4 features. But I may have overlooked something. You can get the source from any of the JDK 1.4 downloads. Try compiling just the Matcher and Pattern class, and see what additional classes you need. Locate the source for these as well, and try again. Repeat until you either have a nice finite set of classes you need, or you get tired of the unending list of other things you must import, if that's what happens. (Or until you find something that requires a native method.) You may need to make other modifications, in which case I'd change the package name too so you don't confuse those classes with the "real" ones when they eventually arrive. Good luck; let us know if it works. [ August 27, 2002: Message edited by: Jim Yingst ]
Well, it doesn't seem that our search utility is capable of actually finding such a past conversation based on such nebulous hints. It was over in the beginner's forum within the past two weeks. So feel free to enlighten us. Hmm... Wait a minute, I'm thinking of something clever to say... Gee, that sounds familiar.