Skip to content

rwitzel/streamflyer-regex-fast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis build status GPL-2.0

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.

Installation

streamflyer-regex-fast-1.0.1 is compiled with JDK 1.6.

Download

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>

Dependencies

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>

Questions, Suggestions, Issues

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

About

Fast matching on character streams

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages