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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
cfb
Newbie


Joined: 26 Mar 2011
Posts: 9

PostPosted: Mon Jun 06, 2011 5:51 pm   

Pattern Matching with %match
 
Hey all!

I've been trying to use the %match function to detect the follow "(*) corpse (sprawled on the floor)" from a string list but I have run into some trouble. the * wildcard doesn't appear to work (at least in how I've been using it) and while I can get it to detect the word corpse, I can't seem to make it detect anything inside the (). I've tried assigning the pattern to a variable and then placing the variable into the %match function but no luck!

Any ideas on what sort of syntax to use here?

Thanks again for all the help!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jun 06, 2011 8:08 pm   
 
The () are special pattern-matching symbols, so the above syntax is trying to look for the phrase "abc123@#$ corpse sprawled on the floor". While there may or may not be a better alternative to *, you should only need to quote the parentheses.
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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