|
|
|
|
|
by tome
636 days ago
|
|
"Cute" comes across as very dismissive. I'm not sure if you intended that. lens-regex-pcre is just a wrapper around PCRE, so anything that works in PCRE will work, for example, from your Mozilla reference: ghci> "California rolls $6.99\nCrunchy rolls $8.49\nShrimp tempura $10.99" ^.. [regex|\p{Sc}\s*[\d.,]+|] . match
["$6.99","$8.49","$10.99"]
"Spacing combining mark" seems to be "Mc" so this works:https://unicode.org/reports/tr18/#General_Category_Property ghci> "foo bar \x093b baz" ^.. [regex|\p{Mc}|] . match
["\2363"](U+093b is a spacing combining mark, according to https://graphemica.com/categories/spacing-combining-mark) I think in general that Haskellers would probably move to parser combinators in preference to regex when things get this complicated. I mean, who wants to read "\p{Sc}\s*[\d.,]+" in any case? |
|
And I am not sold on lens-regex-pcre documentation; "anything that works in PCRE will work" comes across as very dismissive. What string-like types are supported? What version of PCRE or PCRE2 does it use?