Provides a faster algorithm to match regular expressions on character streams than the algorithm used by Streamflyer.
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".
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.
See above.
streamflyer-regex-fast-1.0.1 is compiled with JDK 1.6.
streamflyer-regex-fast-1.0.1 can be downloaded from Maven Central.
The Maven coordinates are
<dependency>
<groupId>com.googlecode.streamflyer-regex-fast</groupId>
<artifactId>streamflyer-regex-fast</artifactId>
<version>1.0.1</version>
</dependency>
streamflyer-regex-fast-1.0. depends on Streamflyer and Commons IO.
The maven coordinates of theses dependencies are
<dependency>
<groupId>com.googlecode.streamflyer</groupId>
<artifactId>streamflyer-core</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.0</version>
</dependency>
Please read the corresponding section on the web page of the streamflyer project.