Andreas Abel
Andreas Abel
Hi @Martinsos! The type of `~=` is very polymorphic, see https://hackage.haskell.org/package/regex-tdfa-1.3.1.1/docs/Text-Regex-TDFA.html#v:-61--126- . So maybe you can get your use case by a suitable instantiation of the involved type classes `RegexMaker`...
(While I cannot contribute anything now, I leave this issue open so passers-by can get involved.)
Could you submit a small Haskell program demonstrating the problem? Then it would be easy to compare the behavior of `regex-tdfa` to the other implementations, like `regex-pcre`, `regex-posix` etc.
What the others do: - `regex-pcre` does what you want (finds the digits). - `regex-posix` finds no matches Concerning `regex-tdfa`, if you look up the documentation at https://hackage.haskell.org/package/regex-tdfa under section...
Predefined character classes we could support are listed here: https://en.wikipedia.org/w/index.php?title=Regular_expression§ion=13#Character_classes One could recognize them either directly in the parser: https://github.com/haskell-hvr/regex-tdfa/blob/95d47cb982d2cf636b2cb6260a866f9907341c45/lib/Text/Regex/TDFA/ReadRegex.hs#L94 Maybe it is better to handle them in the translation:...
There seems to be already code for POSIX character classes: https://github.com/haskell-hvr/regex-tdfa/blob/95d47cb982d2cf636b2cb6260a866f9907341c45/lib/Text/Regex/TDFA/TNFA.hs#L798-L805 These can be given to `Pattern`s `PAny` and `PAnyNot`: https://github.com/haskell-hvr/regex-tdfa/blob/95d47cb982d2cf636b2cb6260a866f9907341c45/lib/Text/Regex/TDFA/Pattern.hs#L45-L46 @asarkar: The syntax accepted by `regex-tdfa` is `[[:digit:]]` instead...
> [regex101.com/r/griuTm/1](https://regex101.com/r/griuTm/1) shows `\d`, is that the correct link? No, `\d` should be replaced by `[[:digit:]]`. I updated the regex, but the link didn't update. Supporting Perl-style regexes like `\d`...
This exercise would be https://exercism.org/tracks/haskell/exercises/phone-number . Please bear with me, I still have trouble understanding the importance of supporting `\d` etc. > For example, given below is a question that...
Ok, thanks for your input, @asarkar ! I need to balance between convenience and stability. I'll leave this open and see if other users chime in.
Thanks for the report, @twhitehead! I suppose this is a issue with the Wiki rather than with `regex-tdfa`, but there is no bug tracker at the Wiki. The Wiki does...