Hacker News new | ask | show | jobs
by cfv 2033 days ago
It'd be absolutely bonkers if you could use this exact same DSL to generate valid strings
3 comments

Well, since you can use the regex itself to generate valid strings, it's certainly possible.
https://github.com/lambdaisland/regal

Is a regex DSL that will let you do that, wouldn't be surprised to see others

You can - use this to generate a regex, then run that regex through one of these libraries: https://stackoverflow.com/a/22133/126183