|
Getting a trigger on something that may be there or not
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Metsuro
USA (389 posts) 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 | top |
|
| Posted by |
Flannel
USA (1,230 posts) 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. | top |
|
| Posted by |
Metsuro
USA (389 posts) 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 | top |
|
| Posted by |
Flannel
USA (1,230 posts) 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. | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) 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 | 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,371 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )