I have not used it yet and I’m not sure how “regexp safe” the above DSL is (if it is feasible to construct a “bad” regex with it) but it looks really nice in action:
Good to know. Thanks! Maybe we should try to solve these limitations as this lib is also an interesting piece / example of a DSL construction in PS.
P.S.
To be honest I sometimes use unsafeRegex when building a Regex. I use this construct on the top module level so it blows up really quickly (please check the console) during a first run (nearly the “compile time” :-P).
Maybe showing to the reader that not everything can be easily proven to be type safe has a value on its own. I think that is is good to be aware that it is really easy to leave the safe PS land and fallback into the ugly unsafe solution when it is necessary. It is also an opportunity to answer the question why we have something like unsafeRegex in the given lib at all and how to use such a tool to minimize a possible damage.