Ignore escaped multi-line quotes

Viewed 200
1 Answers

I am on a mobile Phone and I don't have a computer to test, but something along these lines should work:

string('"""') & (string(r'\"""') | any()).starLazy(string('"""')) & string('"""')

This parses the triple quotes, followed by any sequence of the escaped triple quotes or other characters, until we reach the ending triple quotes. Possibly you want to also add a .flatten() to the inner part to get a plain string as return value.

Related