I am trying to write a sublime syntax for a config file used in one of my programs. Sublime syntax files use regex to perform syntax highlighting. Here is an example:
Database=Something
#Database=SomethingElse
The regex should match the first equal sign, but not the second one. That is: match an equal sign that exists in a line that does not start with #. This is what I have right now:
(?'before'^(?!\#).*(?==))(?'equal')=
The regex generates two groups: before and equal. I want to only match the second group (equal). This has to be done purely in regex and not in any programming language so I'm not sure if that is possible. If you have any suggestions or workarounds let me know. I think the solution might be to use a look behind but I haven't been able to make that work.