▲ | zokier 9 days ago | |
> just the syntax becomes unreadable rather quickly. I’m sure you could build a nicer regular-expression syntax in Haskell. Of course regular expressions are really more of a category of expressions, and the traditional kleene star notation is only one of many options; regular expressions do not somehow inherently need to use that specific syntax. Pomsky and VerbalExpressions are just some examples of alternative syntaxes for regex. Apparently there is even a port of VerbalExpressions for Haskell: https://github.com/VerbalExpressions/HaskellVerbalExpression... | ||
▲ | qrobit 9 days ago | parent [-] | |
I looked at the VerbalExpressionJS[1] example and it looks like combining parsers to me. If you need to make regex more verbose, better use parser combinator library when available. RegEx benefits compared to parser combinators other than compactness aren't obvious to me. [1]: <https://github.com/VerbalExpressions/JSVerbalExpressions/tre...> |