I am writing a PEG file to be used in pest for our dsl. There is need where i need to parse a key value where value is a regex within triple quote. I am unable to write a pest rule for it.
The value is """Some regex here"""
Rule I defined is:
TQ = {"\"\"\""}
and I need
regex = {TQ ~ Anything but not TQ ~ TQ}
I tried with
regex = {TQ ~(!TQ)* ~ TQ}
which doesn't work and not proper PEG
regex = {TQ ~ ANY* ~ TQ}
which greedily consumes all token even triple quotes at the end
The rule should parse regex inside triple quotes like
"""^\w+\s+\d\d\d\d\-\d\d\-\d\d\s+\d\d\:\d\d\:\d\d\s+AB_02V\s+\d+\s+.*"""