I would like to colorize in a special color all my constant which are all in capital letters in my code and all my method variables which begin with an @.
Is it possible to use Regex to define keywords with listings package ? It will help me for a lot of things !
For example, I actually have in a \lstdefinestyle:
keywords=[3]{@someName,@anotherName,@aboutOneHundredMore}
keywords=[4]{SOME_NAME,ANOTHER_NAME,ABOUT_ONE_HUNDRED_MORE}
--> If I could replace this by:
keywords=[3]{/@.+/}
keywords=[4]{/[A-Z_]+/}
it will save me from a lot of work !
If not, is there another way to have all my constant in a special color without defining all of them one by one in a keywords list ?
I first think about using morecomment or moredelim for the @ part but the ending character is problematic: it can be a space, a dot or a lot of other characters...
mintedit would be possible, by defining a suitable lexer. – egreg Jul 15 '14 at 12:10morecomment? For example:morecomment=[s][\color{Red}]{@}{\ ,.,]}ormorecomment=[s][\color{Red}]{@}{\ }{.}{]}– Matthieu.P Jul 15 '14 at 12:29