How can I match everything between a pair of / characters with treetop? I would also like to match escaped / characters as well. For example, if I were to parse a "regex":
/blarg: dup\/md5 [0-9a-zA-Z]{32}/
The result would return:
blarg: dup\/md5 [0-9a-zA-Z]{32}
This should match everything inside two
/characters including escaped slashes. I'm using Ruby'sDATA__END__feature so that everything can run in a single file.Also, note that you can tag parts of a parsed expression and then use them as functions. In the example below I tagged
inside. This could also have been accessed aselements[1]instead of being tagged.This works similar to matching a string which you can find in the treetop docs.