|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Feb 03, 2005 11:13 am
Highlighting text with #CW |
Another hopefully easy question
I have a variable that highlights any instance of certain items (player names for example). The problem is that when player names appear in the middle of other words then half of those words gets highlighted.
For example.
whoList = {Guinn|Bob|Joe|Sun}
#TR {{@whoList}} {#CW $EEBB66}
If the output is then:
output: Guinn says, "Hello bob, how's life?"
result: Guinn and Bob will be highlighted. Just what I want
output: The sun rises slowly in the east.
result: sun is highlighted - this is wrong, but I know completely unavoidable, since zMud can't tell the context.
output: The ball bobbles on the edge for a moment before falling.
result: 'bob' is highlighted because it's part of bobbling - this is what I want to avoid
I'm guessing it's some sort of matching I need to say that if the match occurs separately then highlight it, but if it's part of another word then don't. Problem is I can't force it to match a space at the start and end of the word, since the name may appear at the beginning, or may have punctuation at the start or end. So... any way to have it match Bob! but not Bobb, or Sun but not Sunday.
Thanks again |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Feb 03, 2005 1:14 pm |
#TR {%q{@whoList}%q} {#CW $EEBB66}
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Feb 03, 2005 2:41 pm |
Perfect, ta
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Feb 04, 2005 12:47 am |
Also you can check the case-sensitive option in the Options panel of the Settings Editor. The should eliminate few erronious matches.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|