Regular Expressions in Java

Package com.stevesoft.pat version 1.5.3

Blog
Home
Articles/Links
Mugs, T-shirts Comments/Raves
New in 1.5.3
A Game
An Online Test
Questions

Copyright/License
Download Free

 If you need a non-LGPL version
You Can Buy!

Online help...
Quick Start
Tutorial Part 1
Tutorial Part 2
Tutorial Part 3
Tutorial Part 4
Tutorial Part 5
Tutorial Part 6
Examples
Support
FAQ
Documentation

Useful apps...
Java Beautifier
Code Colorizer
GUI Grep
Swing Grep

Other stuff...
Phreida
xmlser

Donate towards my web hosting bill!

Welcome

Package Pattwo (updated 9/29/2008): Package pattwo is a new, from scratch, regular expression implementation that conforms (mostly) to the interface established by java.util.regex.
Some differences include:
  1. No stack overflows or out of memory errors. Ever.
  2. No backwards searches, i.e. (?<=X), (?<!X)
  3. No && inside entities, e.g. [[abc]&&[def]]. Only simple perl-type entity descriptions.
  4. Matcher can take a Reader object.
  5. Package name. To use it, replace "import java.util.regex.*" with "import com.stevenrbrandt.ubiq2.v4.pattwo.*".
Downloads:
  • pattwo-bin-v4.jar Compiled with java 1.6.
  • pattwo-doc-v4.zip Presently the java docs contain very little description. Since the package conforms fairly closely to java.util.regex this should not be a problem.
Brief Release Notes:
  1. v4: Many bug fixes relating to patterns similar to (a*)*, [-a], [a-].
  2. v1: Initail release
Note: Many people have enjoyed the tutorial I made for my package, and I've received a few requests for an adaptation to Sun's java.util.regex package. I'm happy to report the tutorial is available as a freely downloadable pdf. You can also buy a print on demand version for which I will receive $1.

Note: Quick & dirty xml tip on JavaWorld. This code is currently in use in cell phones and streaming stock quote programs. What can you do with it?

Note: Ever wanted a package pat mug? You can now buy one at our Cafe Shop. But that's not all you can get, there's some science fiction theme t-shirts, and mouse pads.

Package pat provides a mechanism for compiling and matching regular expressions in java. It has numerous features:

  1. Online since May of 1996: Many Java software companies and packages have come and gone since Java was invented. Package pat has demonstrated persistence.
  2. Y2K: Since package pat uses no internal representation of dates it never had a Y2K problem.
  3. Support for all the pattern matching capabilities of Perl 5.
  4. Polymorphism: Package pat can match on a String, an array of characters, or a RandomAccessFile.
  5. Support for unicode: Matches that ignore case take into account all three cases of unicode. Special patterns are supplied to match characters with certain unicode properties (read more).
  6. Support for reverse searching within a String.
  7. Documentation: Whether you want javadoc comments, a tutorial, or examples of use it's all available at left.
  8. Package pat was used to construct a Java Beautifier for use in Borland's JBuilder. It will format and properly indent source files. Version 1.0 is free if you have a license for com.stevesoft.pat.
  9. Speed: If the optimize() method is called package pat uses a Boyer-Moore Horspool search (if the pattern begins with a literal text string).
  10. Just Java: No native code is employed by package pat.
  11. Java 1.0 support: If you need to restrict yourself to using java 1.0 you can still use pat.