Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Mon Mar 14, 2005 1:12 am   

endline $ in stringlist in trig pattern
 
#TR {({@names}){,| |$}} {irrelevant}

When I type QW, I get a list of names separated by commas and mtuliple lines long. I like to colour names in this list different colours that mean something to me. This is pretty standard. In the past I've just done something like: #TR {{@enemies}} {#CW 12}

For various reasons, I'm changing the way I do it. While doing this, I also wish to tidy it up a bit.. I dont want it colouring partial names. So.. if I have "Mal" in a list to be coloured, I dont want it colouring maltik, malhavoc etc etc.

The solution as I've found it, is simply to force the trigger to only match IF the word is a whole word - i.e. is followed by a comma, space or the end of a line ($). The first two work fine, but the trigger pattern is treating the $ as a ~$ and not as a special char specifying the end of the line.

Is it possible for force it to treat the $ as I wish, or perhaps is there another way to make the trig only fire on a whole word and not a partial word?

I know I could create a duplicate trigger
#TR {({@names})$} {}
but I do not want to do it that way if I can avoid it, as broad triggers like this do tend to slow down line parsing a little, and I'd rather not dupicate it because of this.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon Mar 14, 2005 1:38 am   
 
#TR {%q({@names})%q} {}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Mon Mar 14, 2005 1:55 am   
 
ah... wow. Thanks. I didnt try that cos I assumed it wouldn't match white space. Works perfectly, thankyou!
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Mon Mar 14, 2005 1:59 am   
 
Although - it doesn't work if I add the %q at the beginning - which doesn't matter as I only colour if the names are %proper. Figured you might like to know that, however - for some reason %q at the beginning does not match on white space.
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Mar 14, 2005 3:45 am   
 
Its pretty weird that it doesn't and if you convert the trigger to a regex trigger it matches at the start as well as end.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net