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
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Oct 31, 2008 5:40 pm   

Pattern Matching From a Var
 
Ok, heres the situation...
I have a list var, and I'm matching it in a trigger pattern.

#TRIG {{@List}} {bah}

Now, say George is part of the list...

How do I STOP it from triggering on Georgette?
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Oct 31, 2008 6:22 pm   
 
Use the pattern %q{@List}%q. %q is an analogue of the \b regex, which is a zero-length character. It matches the space between a word character (a-z0-9) and something that's not a word character (anything else). So it'll match George only if it's preceded by, say, a space or the beginning of the string. But %q doesn't match a character; it matches a space between characters, so anything you do with the match afterwards won't be screwed up by it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Oct 31, 2008 8:26 pm   
 
Ok, I knew there was a way to do it, but I couldn't remember. Thanks Fang.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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