Trigger help

Posted by Assassin on Fri 19 Mar 2004 12:22 AM — 3 posts, 17,738 views.

#0
* the * * has just left

*>Bob the builder has just arrived
*>Bob the builder has just left

Its capturing *> and storing that to my variable.

How can i avoid this?

Also when im attacked by a dog

Output says You are attacked by the dog!

Again its storing ! along with dog, how can i stop this
too

Amended on Fri 19 Mar 2004 12:49 AM by Assassin
USA #1
The easiest and most effective way is to make your triggers more precise. If you know the punctualtion will always be at the beginning or end of a line, modify the trigger to include the punctuation.
Australia Forum Administrator #2
Click on "convert to regular expression". For your example that gives this:


^(.*?) the (.*?) (.*?) has just left$


Then you can make it more precise. For example an optional thing like *> could be added at the start:


^(?:\*\>)?(.*?) the (.*?) (.*?) has just left$



The extra bit I added (in bold) looks for 0 or 1 occurrence of *>. I "escaped" them with a backslash because the * (at least) has a special meaning in regular expressions. The ?: at the start says to not make it a wildcard (so wildcard %1 is still the same thing).

Read up here:


http://www.gammon.com.au/mushclient/regexp.htm