I need to write a parser that can extract all the text between two parentheses:
parser("left-text ( text-to-extract ) right-text") = "text-to-extract"
The text-to-extract
may contain parentheses, while both left-text
and right-text
cannot.
I'm using Scala parser combinators, and I would like the solution to fit into it. Can you help me?