Use stringCI
from Data.Attoparsec.ByteString.Char8
. Consider switching to Text
if you want the comparison to be Unicode-aware (e.g. so that "ß" is treated as equal to "ss").
How can you make the latest Attoparsec match strings in a case-insensitive way?
-
06-10-2022 - |
Question
attoparsec 0.72 had this function but it seems to have disappeared in later versions:
stringTransform :: (ByteString -> ByteString) -> ByteString -> Parser ByteString
"Match a literal string, after applying a transformation to both it and the matching text. Useful for e.g. case insensitive string comparison."
http://hackage.haskell.org/package/attoparsec-0.7.2/docs/Data-Attoparsec.html
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow