I would like to highlight any expression made of letters and that starts with one @. The use of moredelim=*[s][\color{blue}]{@}{\ }
works only in case like @name
is followed by one space. The following code nearly works except that I do not want the parenthesis to be colored in case like @decorator(x=3, y='some text')
because that is @decorator(
which is caught.
moredelim=[s][\bfseries\color{gray}]{@}{\ },
moredelim=[s][\bfseries\color{gray}]{@}{(},
The use of moredelim=[s][\bfseries\color{gray}]{@}{(}
is not a good solution because the search is done on several lines… 🙁
Best Answer
I followed the same approach as in my answer to Can the listings package highlight by regexp?.