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
deathkitty
Apprentice


Joined: 14 Apr 2008
Posts: 105

PostPosted: Wed Apr 30, 2008 12:32 pm   

using wildcards in multiple pattern matching?
 
I also have another slightly-related question:

how do i use a * in a trigger pattern with multiple options? * doesn't seem to work when it's inside {}s

here is an example of what it is like at the moment:
{a fat soldier|an ugly soldier|a smart soldier|a mean soldier}
so you can see what I am trying to do

I want to capture the whole phrase "a whatever soldier", and i want to expand this to have a list of second words too so i can do not just soldiers

not sure what to do really at all

this is completely wrong syntax im sure but again this is the kind of thing i am trying to do so gives you an idea

pattern
({a|an} * {soldier|giant spider|mugger|priest})

captured:
an ugly soldier
a vicious giant spider
a scary mugger
an angry priest

etc
(then I do #cw red)
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Apr 30, 2008 1:51 pm   
 
In short: You can't.
In slightly longer: Use a regex instead.

You could actually just do it the way you have in your trigger there if you like, but a regex will probably neater.

Also, you probably shouldn't be using * unless you really mean "any character". In your examples there, you mean "a word", so you should use %w.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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