|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Thu Jun 12, 2003 10:30 pm
correct trigger syntax |
I am having trouble creating a trigger which will work on all the following matches
(6) (G)(H) glasses of wisdom [198] - matches
(6) (G) glasses of wisdom [198] - matches
(6) glasses of wisdom [198]
glasses of wisdom [198]
i can only get it to match 2 of them with the following trigger syntax
^~(%1~)%s{~(G~)|~(G~)~(H~)}%s(%2)%s~[%d~]
how can i get it to match all 4 with the same trigger or is this not possible?
thanks
mortie :) |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jun 13, 2003 1:14 am |
First you should not use %1..%99 in the trigger pattern. Read the Pattern Matching help for more info there.
Next thing is use of *, it is capable of matching any number of characters including none but your 3rd and forth patterns will cause hiccups in which values things are stored to.
Since your current pattern indicates beggining of line, and the mud was nice enough to provide blanks for those portions that are not present you can use a fixed width pattern or a range, and parse it within the trigger for the numeric value you want. (I forgot to count the width so double check it if you go that way.)
#TR {^(&11) (*) ~[%d~]} {Count=%eval(%word("%1",1));#NOOP whatever else you wanted to do}
or
#TR {^([1234567890GH() ])(*) ~[%d~]} {Count=%eval(%word("%1",1));#NOOP whatever else you wanted to do} |
|
|
|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Fri Jun 13, 2003 7:52 am |
Thanks for the reply Vijilante
I used a combo of the two
#TR {^(&5)([1234567890GHMI() ]) (*)%s~[%d~]}
and its working just great now
thanks for the help
mortie :) |
|
|
|
|
|