syntax file highlight a string

General questions about using TextPad

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

Post Reply
rockmead76
Posts: 1
Joined: Wed Feb 13, 2008 10:40 am

syntax file highlight a string

Post by rockmead76 »

Hi,
I am slowly getting to grips with a syntax file and have applied it in several situations, but I would like to highlight strings of words i.e.

In a document I have that contains
unspecified error
error
unspecified

and I want

unspecified error
error
unspecified

I don't want to highlight just unspecified or error, I want to highlight both when they appear together.

Is this possible ? if so how whats the syntax ?

Thanks

Paul
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Unfortunately, string highlighting is limited to words.

Can you use unspecified_error?
Hope this was helpful.............good luck,
Bob
ljwheeler
Posts: 3
Joined: Fri Feb 15, 2008 4:12 pm
Location: NE OK USA
Contact:

Post by ljwheeler »

Bob Hansen wrote:Unfortunately, string highlighting is limited to words.

Can you use unspecified_error?
I too have wanted a way to highlight multiple words using a single entry in my syntax files.

Does the underscore act as a wildcard?

A wildcard is something I've wanted with TextPad syntax files. For example, instead of defining the following 3 definitions:

AUTBAT01I
AUTHSC01I
AUTTMS01I

It would be great if I could define a single definition using something like:

AUT***01I

Or if the underscore does work as a wildcard character, a single definition such as the following would do the trick:

AUT___01I

Otherwise, TextPad is the best editor I have ever used.
kkaran
Posts: 6
Joined: Thu May 01, 2008 4:54 pm
Location: New York City

Post by kkaran »

I see there has been a similar response in topic 8598: http://forums.textpad.com/viewtopic.php?t=8598. In my syntax file that views log files after compilation, I have SingleCommentColAlt set to "Warning." I then set comments to blue. This highlights all lines that begin with that word. I'd like to set "SingleCommentColAlt" to "Note: Missing" but there is a space in that string.

Can I put a %20 or a 32d literal in place of the space? Is there some kludge that will make Textpad think two words are really one?

Any suggestions would be appreciated.

An everyday TextPad user.
nvj1662
Posts: 53
Joined: Thu May 17, 2007 10:02 am

Post by nvj1662 »

FWIW, I too would appreciate such a facility.

I have written a syntax file for some logs that my software creates and, whilst it is great to be able to use the limited colour highlighting available, it would be a major advantage to have greater control. :)

IMHO, extensive and open flexibility of configuration has always marked the great and useful programmes from the run-of-the-mill. Extension of the .syn files are an opourtunity here. :wink:
Post Reply