Page 1 of 1

syntax definition file help please

Posted: Tue Sep 16, 2003 8:27 pm
by Kevin
I want to color highlight in my document the occurences of a M[0-9][0-9] and the occurences of a G[0-9][0-9].

Example:
  • N00026M68
    N00027G00
    N00028M67
Only the M68, G00, and the M67 should be color highlighted.
The numbers can range between 00 and 99.
The M[0-9][0-9] and the G[0-9][0-9] may occur anywhere on the line.
Sometimes the M[0-9][0-9] and G[0-9][0-9] might appear on the same line, together M00G00 or M00blahblahG00.

It's okay to use the same color for both the M[0-9][0-9] and the G[0-9][0-9]. If it's possible, separate colors are preferred.

Posted: Wed Sep 17, 2003 12:15 am
by Bob Hansen
Make your own syntax file with 200 keyword lines:

Keywords 1=G00-G99

and

Keywords 2=M00-M99.

Posted: Wed Sep 17, 2003 12:49 pm
by Kevin
Thanks Bob,

I like the simple solutions. Your suggestion works like a champ.