cjheath / treetop

A Ruby-based parsing DSL based on parsing expression grammars.
https://cjheath.github.io/treetop
MIT License
306 stars 22 forks source link

Regex for matching a string except a particular string #15

Closed roots-ai closed 10 years ago

roots-ai commented 10 years ago

Hi

I want to write a regex to match all strings except string "ABC".

This works well on rubular ^(?!ABC$).*. But it throws a syntax error for me in the grammar file. I also tried [a-zA-Z]+!(ABC) and this also throws a syntax error. I am unable to figure out the right syntax for this. I tried to follow this tutorial http://treetop.rubyforge.org/syntactic_recognition.html, but still unable to solve this issue. Please help.

cjheath commented 10 years ago

Github issues is not a support forum. Please use the google groups for that.