|
cingulli Wanderer
Joined: 30 Aug 2001 Posts: 53 Location: Finland
|
Posted: Thu Nov 08, 2001 2:50 pm
Help in pattern-matching |
Need to make #trigger with a pattern-match: likes ' duck !%1!{$| %2}' to work.
It should match 'duck !down!' and 'duck !down! deep' texts. But how do you put them into
one pattern-match? |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Thu Nov 08, 2001 3:15 pm |
No idea how to put them into a single trigger, but you can make two:
#TRIGGER {duck ~!(%w)~!$} {StuffToDo}
#TRIGGER {duck ~!(%w)~! (%w)$} {StuffToDo}
Acaila |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Nov 08, 2001 4:42 pm |
#TR {duck ~!down~!} {your response}
This will match:
Duck !down!
Watch out! There's a duck !down! there.
duck !down! deep
or anything else that has the phrase "duck !down!" somewhere in the line.
LightBulb |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Thu Nov 08, 2001 6:23 pm |
Placing a wildcard inside a bracketed OR pattern will never work.
#TR {duck ~!(%w)~! {$|(%w)}} {whatever} is just illegal, sorry. You'll have to make two triggers if you wish to capture the parameters.
Troubadour |
|
|
|
Castaway GURU
Joined: 10 Oct 2000 Posts: 793 Location: Swindon, England
|
Posted: Fri Nov 09, 2001 9:17 am |
Alternatively, you could just trigger on "duck ~!(*)" and take the resulting string apart afterwards :)
Lady C. |
|
|
|
|
|