|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: 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. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon Mar 14, 2005 1:38 am |
#TR {%q({@names})%q} {}
|
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: 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 |
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: 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 |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: 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.
|
|
|
|
|
|