|
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: Sun Aug 31, 2003 4:30 am
highlighting Absolute Values |
I am trying to colour names of allies, but sometimes thier name appears as a portion of another word and that gets highlighted too. What is the syntax to say only highlight this name?
example ally name =
trigger Tamara
command #CW green
if a word like tamaranth shows up somewhere it highlights "tamara" in that word |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sun Aug 31, 2003 6:37 pm |
"^" forcess pattern to match the bigining
"$" forcess pattern to match the ending
so
trigger Tamara$
zmud help files= pattern matching. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Aug 31, 2003 9:15 pm |
In order to limit the highlighting to whole words, you have to supply the preceding and following characters (which will also be highlighted). In other words, you'll need a pattern for every possible beginning with every possible ending. I suspect most people eventually decide it's not worth the extra patterns and just tolerate the highlighting of tamaranth.
#TR {^Tamara } {#CW green}
#TR {^Tamara%p} {#CW green}
#TR {^Tamara$} {#CW green}
#TR { Tamara } {#CW green}
#TR { Tamara%p} {#CW green}
#TR { Tamara$} {#CW green} |
|
|
|
|
|