streamflyer-regex-fast


Fast matching on character streams

Provides a faster algorithm to match regular expressions on character streams than the algorithm used by streamflyer.

Usage

A typical example: ``` // choose the character stream to modify Reader originalReader = ... // this reader is connected to the original data source

// we use FastRegexModifier instead of RegexModifier Modifier fastModifier = new FastRegexModifier("edit(\s+)stream", Pattern.DOTALL, "modify$1stream");

// create the modifying reader that wraps the original reader Reader modifyingReader = new ModifyingReader(originalReader, fastModifier);

... // use the modifying reader instead of the original reader ```

In this example the chosen Modifier replaces the string "edit stream" with "modify stream". The modifier preserves the whitespace between "edit" and "stream".

Why is this fast matcher not included in the streamflyer project itself?

The code of the fast matcher relies on a modification of the java.util.regex package. The regex package is licensed with GNU General Public License v2 but the streamflyer project is licensed with Apache License 2.0. In order to deal with this license mismatch, the fast matcher is separated from the streamflyer project.

Why licensed with GNU General Public License v2?

See above.

Download

Go to the Installation page to get the latest release. This page provides also the Maven coordinates, prerequisites, and information about dependencies to other libraries.

Questions, Suggestions, Issues

Please read the corresponding section on the web page of the streamflyer project.

Project Information

The project was created on Mar 2, 2012.

Labels:
stream editor java reader writer sed regex