You can turn it into an SMT problem and solve it with a standard solver. In Haskell it&#x27;s quite beautiful as you can write code that&#x27;s basically identical to writing a parser, and then generate inputs that satisfy the parser magically.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ekmett&#x2F;ersatz&#x2F;tree&#x2F;master&#x2F;examples&#x2F;regexp-grid" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ekmett&#x2F;ersatz&#x2F;tree&#x2F;master&#x2F;examples&#x2F;regexp...</a>