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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Mon Jan 29, 2007 4:34 am   

2 similar trigger patterns
 
I have 2 similar trigger patterns, one being
~(o~)&oname~.
and
~(o~)&oname ~(*~)~.
I was wondering if there was an easy way to differentiate between these two, the items look like
(o)An item. or
(o)An item (enchanted).
the problem is the 1st trigger will catch both patterns so i get some spam, i tried using regex and [^()] but that just removed the last letter of the word instead.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Jan 29, 2007 5:12 am   
 
I'm not sure about ZMud patterns, but off the top of my head regex would be

^\(o\)(&oname:[^(]+)\.$
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jan 29, 2007 5:24 am   
 
&varname can be type-cast using other wildcards, but that's probably not going to help in your case. Perhaps the range pattern would fill your needs?

#trigger {~(o~)([%w%s])*.} {}

You might need to drop off the period at the end of the pattern, I don't recall for sure if * matches on "non-existent text". Also, you may need to add specific symbols to match all the other ones used in item names.
_________________
EDIT: I didn't like my old signature
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Jan 29, 2007 5:45 pm   
 
* works like .* in regex, matches any number including none.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Tue Jan 30, 2007 2:44 am   
 
thanks, i was trying combinations with the &varname and not getting any luck. the ~(o~)([%w%s])*~. worked perfectly
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