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
- Host: GitHub
- URL: https://github.com/hex0cter/xeger
- Owner: hex0cter
- Created: 2015-03-24T21:50:40.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-26T09:31:04.000Z (about 11 years ago)
- Last Synced: 2025-08-03T04:32:42.078Z (10 months ago)
- Language: Java
- Size: 152 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
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.