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 ➜ VBscript ➜ trigger matching text

trigger matching text

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


Posted by Thebloodsiren   (13 posts)  Bio
Date Fri 24 May 2002 06:00 AM (UTC)
Message
Probably just me but i cant work out how to make a trigger to catch this text:

(A|An) <wildcard1> (male|female) <wildcard2> in from the <wildcard3>.

So then it would match for the following text:
An orange-eyed male human walks in from the west.
That would match:
<wildcard1> = orange-eyed
<wildcard2> = human walks
<wildcard3> = west

Little help please.
Thanx

-----------------------------------
Calm down, its only ones and zeros.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 24 May 2002 07:01 AM (UTC)
Message
To use "A" or "An" you have committed to regular expressions, so we'll do it with them. :)

To get wildcards you need to put the text in brackets, however you don't care about wildcards 1 and 3, so just ignore them. The trigger would be like this:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="(A|An) (.*) (male|female) (.*) in from the (.*). "
   regexp="y"
   send_to="2"
   sequence="100"
  >
  <send>wildcard 2 = %2
wildcard 4 = %4
wildcard 5 = %5
</send>
  </trigger>
</triggers>

- 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,349 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.