An open API service indexing awesome lists of open source software.

https://github.com/hex0cter/xeger

Automatically exported from code.google.com/p/xeger
https://github.com/hex0cter/xeger

Last synced: 10 months ago
JSON representation

Automatically exported from code.google.com/p/xeger

Awesome Lists containing this project

README

          

#Xeger

Imported from code.google.com/p/xeger

Think of it as the opposite of regular expression matchers. This library allows you to generate text that is guaranteed to match a regular expression passed in.

Let's take the regular expression: [ab]{4,6}c Using Xeger, you can now generate Strings matching this pattern like this:

String regex = "[ab]{4,6}c";
Xeger generator = new Xeger(regex);
String result = generator.generate();
assert result.matches(regex);
Note that - in order to use Xeger - you will also need the dk.brics.automaton package, that you can download as a library here: http://www.brics.dk/~amoeller/automaton/

Be sure to read XegerLimitations to learn about the limitations in regular expressions supported.