Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Trigger failing

Trigger failing

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Fri 26 Sep 2003 07:18 PM (UTC)

Amended on Fri 26 Sep 2003 07:22 PM (UTC) by Poromenos

Message

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="Hello there (.*?)"
   regexp="y"
   send_to="2"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  <send>%1</send>
  </trigger>
</triggers>

This trigger matches, but doesn't send anything to output... To match, I use "Poromenos says 'Hello there Poromenos'", and nothing. What am I not seeing?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 27 Sep 2003 12:12 AM (UTC)
Message
Because you have turned off "greedy" matching the thing in the brackets is matching the minimal amount it can, not the maximum.

Try making the regular expression:

match="Hello there (.*)"

That matches better.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #2 on Sat 27 Sep 2003 11:57 AM (UTC)
Message
Are you sure this is it? Because I seem to remember turning it to a normal trigger and back to regexp, and it matched... Not sure though...
When you have "Hello (.*?)" isn't it supposed to match
there
on
Poromenos says: Hello there
?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #3 on Sat 27 Sep 2003 11:58 AM (UTC)
Message
But yes, I suppose that if it's non greedy it would match the rest of the line if i had the $ at the end...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Tue 30 Sep 2003 06:33 AM (UTC)
Message
Yes, non-greedy in the middle of a line (without the $) is going to try to match a minimal amount.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,592 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.