Regex help


#1

How may I regex that class.variable will have some special colors, so I’d want class to be named class, the . will have no name and ‘variable’ will be named variable.

I also want this to be able to continue untill the variable has been detected
For example

class.class.class.class.variable

where class is named class
and . has no name
and variable is named variable

How would I do this syntax?


#2
{
  'match': '\\bclass(?=\\.)'
  'name': 'class'
}
{
  'match': '(?<=\\.)variable\\b'
  'name': 'variable'
}

https://github.com/atom/language-javascript/blob/2ba9a9891f70729226fb80ea727ee25bd0db2bc7/grammars/javascript.cson#L1794-L1854 should help.