Getting a trigger on something that may be there or not

Posted by Metsuro on Tue 17 Aug 2004 10:30 AM — 5 posts, 18,559 views.

USA #0
^(An|A|The) (.*?) is DEAD\!\!$

i want it to also just catch on blah is dead!! dont know how i would do that really
USA #1
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\!\!$
USA #2
well i am trying to get it so if those three things there it will match, if not it will still match
USA #3
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.
Australia Forum Administrator #4
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.