trouble with a regexp trigger

Posted by Qbert911 on Sat 19 Dec 2009 12:50 AM — 5 posts, 16,165 views.

#0
Hello all, and thanks to Nick for a great client.

I'm playing aardwolf and would like to see the stats of an item when it is first auctioned with a trigger.

So when text like:
Razorlight is auctioning >.: (Concealed) Portable Power Source :.< (Level 71, Num 144). Current bid is 100.

I would like the trigger to respond with bidding on the item number like:
bid 144

So far, I have got:
^(?:\w+ )?\w+ is auctioning .+ \(Level \d+, Num (\d+)\). Current bid is \d+.$

action:
bid %1


This doesn't work and I'm rubbish at regexp.

Thank You in Advance,
qbert911
USA #1
That looks correct, except you may want to escape the literal periods (from . to \.), see below. Are you sure the "Regular expression" checkbox on the trigger is checked?

^(?:\w+ )?\w+ is auctioning .+ \(Level \d+, Num (\d+)\)\. Current bid is \d+\.$
Amended on Sat 19 Dec 2009 12:57 AM by Twisol
#2
Ok, tried that, no joy. The regexp button is indeed checked.

In an attempt to simplify things I also tried:
^.+ is auctioning .+ Num (\d+).+$

(which may be wildly wrong)

Using aardwolf-client package (mushclient 4.33).

Thanks,
qbert911
#3
Scratch that, this worked!

^.+ is auctioning .+ Num (\d+).+$

Cheers!
USA #4
If you're going to use .+ on both sides, why not just use this instead?

is auctioning .+? \(Level \d+, Num (\d+)\)


I just removed the anchors and the .+ at the ends, and put in the (Level, Num) part to make it less likely to accidentally match elsewhere. I'm not sure why the first trigger didn't work, to be honest, but I don't play Aardwolf.