syntax definition file help please

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Kevin
Posts: 28
Joined: Tue Apr 01, 2003 7:55 pm

syntax definition file help please

Post 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.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Make your own syntax file with 200 keyword lines:

Keywords 1=G00-G99

and

Keywords 2=M00-M99.
Kevin
Posts: 28
Joined: Tue Apr 01, 2003 7:55 pm

Post by Kevin »

Thanks Bob,

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