This question already has an answer here:
I use the OPL language for optimization and I’m writing some notes on Latex using "listings". I defined the language and the keywords, so far no problems. However I have a keyword “subject to” and a keyword “to SheetWrite” that I need to be colored differently. The problem is the word “to” that appears in both keywords. Is there a way to define two word keywords in listings or otherwise solve this problem?