This has been driving me crazy. I have been playing around with trying to adopt goto functionality for Sylus learnboost.github.com/stylus/
Given this sample code:
padding 12px 0px
border-bottom 1px solid #ccc
border 1px solid #ccc
transition border-color 0.25s
I am trying to match the selector groups (header, nav, nav .portrait, img, &:hover) but not match any of the other lines. I am aware I could match every line and then process submatches on that to determine if it is in fact a valid selector group, but if possible I would like to avoid that and just match the selector groups in one swoop.
I am pretty good at regex and I got it working perfectly on [rubular.com/r/oF8b6TzArG](http://rubular.com/r/oF8b6TzArG), but when I try to do it in a tmLanguage file it does not seem to work at all. Perhaps it is some limitation with backreferences that could be a variable number of spaces?
Here is what I am working with
<string>^( *?)(&\:\.\#a-zA-Z](.*?))(?=\n\1 +)</string>
I am also aware if we assume one selector per line without spaces I could change it to ^( ?)(&\:.#a-zA-Z](\S?))(?=\n) and that will work in Sublime.
Any help would be greatly appreciated.
Also don't worry about the whole tabs vs. spaces thing. After I get it working I can easily adapt it to work with both.