I would like to parse string literals using FParsec. By “string literals” I mean something between opening and closing quote (in my case — single quote):
'Please, switch off your mobile phone'
What I am currently doing is the following:
let string = between (pstring "'") (pstring "'") (manySatisfy isLetter)
But this stops after the first letter consumed. Is there any way to make it greedy?
It’s already greedy;
manySatisfy isLetterparses a sequence of letters from the input stream.The problem is that the parser fails with
,or spaces since they are not letters. It could be fixed by using:or more explicitly using:
instead.