moodmosaic / Fare

Port of Java dk.brics.automaton and xeger, mostly used for generating strings that match a specific regular expression.
http://www.brics.dk/automaton/
MIT License
183 stars 43 forks source link

Xeger doesn't recognize \p{L}, \p{Lu}, \p{N} and possibly others #22

Open bogdan2 opened 8 years ago

bogdan2 commented 8 years ago

Hello:

Just to let you know that I tried to use Xeger to generate random strings based on \p{L}, \p{N}, and \p{Lu} and they don't seem to be supported.

Is there a way to use them?

Thanks

moodmosaic commented 8 years ago

Thank you for reporting this!

Project Fare turns Regular Expressions into Automatons by applying the algorithms of dk.brics.automaton and xeger.

Unfortunately, I don't have an answer to your question, as Project Fare is really a port of the above Java projects. – We'd have to try \p{L}, \p{N}, and \p{Lu} in Java and compare the results.

You may use a different pattern or use a different engine to reverse the Regular Expression into an Automaton. As an example, you can use the Rex engine.