[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Getting a trigger on something that may be there or not

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Getting a trigger on something that may be there or not

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Tue 17 Aug 2004 10:30 AM (UTC)  quote  ]
Message
^(An|A|The) (.*?) is DEAD\!\!$

i want it to also just catch on blah is dead!! dont know how i would do that really

Everything turns around in the end
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Tue 17 Aug 2004 11:08 AM (UTC)  quote  ]
Message
Do you need it to return the name? (Horse in The Horse is dead)
If so, try this:
^(An |A |The )?(.*?) is DEAD\!\!$

If not, and you just do this:
^(.*?) is DEAD\!\!$

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Reply #2 on Tue 17 Aug 2004 11:46 AM (UTC)  quote  ]
Message
well i am trying to get it so if those three things there it will match, if not it will still match

Everything turns around in the end
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #3 on Tue 17 Aug 2004 07:27 PM (UTC)  quote  ]
Message
If you want the noun to return minus the article, then the first should work.
If youre only worried about the line catching, the second would work just as well.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 18 Aug 2004 09:50 PM (UTC)  quote  ]
Message
Like Flannel says, a question mark after a group makes the entire group optional.

eg.

(foo|bar|wet|weather)?

Matches any of those four words, or none of them.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


1,377 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]