Help with a trigger

Posted by Jaegar on Wed 25 Aug 2004 04:44 PM — 3 posts, 12,892 views.

#0
I am trying to get a trigger to work with the following

**Zhara: 'satme'

This is a group tell, I can get the trigger to remove the ** from the beginning but have been unsuccessful in getting my triggers to cast spells on the intended victim. Here is what I get when I receive the above message

cast 'satiate' Zhara: 'satme'

Here is how my current trigger is setup

[^**].*\: \'satme\'$
cast 'satiate' %0

Any help or suggestions would be appreciated.

Thanks,

Jaegar
Amended on Wed 25 Aug 2004 04:46 PM by Jaegar
USA #1
Try:

^[*]+(.*)\: \'satme\'$

or

^\*+(.*)\: \'satme\'$

and:

cast 'satiate' %1

%0 is the 'entire' line that matched, not the part you want returned. () designates which part of that line should be returned.

Also, you where using [] wrong, I think, so I have no idea why it was even matching in the first place. From the regular expression docs, "A character class matches a single character in the subject." It also says that placing ^ in [^**] should be the equivalent of telling it "match on anything except * or *". Likely, if you had been using () and it matched, you would have gotten %1 = "hara", since the [^**] would have clipped off the Z. The way you had it, the expression would have only cared if you ended the line with 'satme', it wouldn't care what the start of the line was, so it was actually ignoring the ** entirely and clipped the first non-* from the line instead.

In other words, your version said:

First find any single character that is not a *, followed by any group of characters, but which must end with ": 'satme'". Do not return anything as a wildcard, except the entire matched line if it was successful.

Regular expressions, as useful as they are, tend to be complicated when you are not sure what you are doing. I knew for instance that what you where doing didn't look right, but had to re-read the docs to figure out why. ;)
#2
Thank you.

It works perfectly.

Jaegar