-1

I use nano as my editor, and I recently added a few syntax highlighting configurations, of which one of them highlights python code. However, one thing that I noticed is that it doesn't highlight decorators. What would be the regex for it?

Note that the actual regex is in bash form.

Thanks in advance.

Lee Garcon
  • 182
  • 10
  • You should be fairly safe matching anything that is not a comment or string where the `@` symbol is the first non-whitespace character on a line. What have you tried? – kojiro May 01 '20 at 01:59

1 Answers1

0

You should be fairly safe matching anything that is not a comment or string where the @ symbol is the first non-whitespace character on a line. So

@[[:alnum:]]+

seems OK to me as long as strings are defined after it.

kojiro
  • 74,557
  • 19
  • 143
  • 201