Emacs highlight variables not prefixed by?

66 views Asked by At

I'm trying to highlight names like "myname", but not "?myname". I've used this regex but the highlight includes the preceding characters:

("[^\\?[:word:]][[:alpha:]][_[:word:]]*" . font-lock-function-name-face)

For example, in "(myname == 1)" the "(" is colored in addition to "myname".

Is there a work around for this?

1

There are 1 answers

0
Drew On

What's wrong with just "[[:alpha:]][_[:word:]]*"?

Character ? has neither alpha nor word syntax. Same for character (.