Suppose there is a simple regular expression (only | and * are allowed). How would you create a stream of strings of any size (from smaller to larger) which match this regular expression in Scala?
Use Xeger. Even though it's Java and not Scala, you should have no problem using it with Scala.
In Java:
String regex = "[ab]{4,6}c";
Xeger generator = new Xeger(regex);
String result = generator.generate();
assert result.matches(regex);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With