I have a file with line endings “\r\r\n”, and use the parser eol = string "\r\r\n" :: Parser String
to handle them. To get a list of the lines between these separators, I would like to use sepBy
along with a parser that returns any text that would not be captured by eol
. Looking through the documentation I did not see a combinator that negates a parser (an ‘anything but the pattern ”\r\r\n”
’ parser).
I have tried using sepBy (many anyToken) end
, but many anyToken
appears to be greedy, not stopping for eol
matches. I cannot use many (noneOf "\n\r")
, because there are several places in my text with the single '\n'
character.
Is there a combinator that can get me the inverse of string "\r\r\n"
?