|
JerzZzzZ Newbie
Joined: 30 Jun 2006 Posts: 3
|
Posted: Fri Jun 30, 2006 12:27 pm
Help with capturing a variable frm a pattern that may differ |
Alright, the pattern may be any one of the following:
1. BIG'GUY is here.
2. (A) BIG'GUY is here.
3. (A) (B) BIG'GUY is here.
4. BIG'GUY LASTNAME is here.
5. (A) BIG'GUY LASTNAME is here.
6. (A) (B) BIG'GUY LASTNAME is here.
Is there a way I can make 1 trigger that'll take out BIG'GUY as the variable regardless of which pattern pops out?
Thanks in advance people. =) |
|
Last edited by JerzZzzZ on Fri Jun 30, 2006 2:18 pm; edited 1 time in total |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Jun 30, 2006 2:02 pm |
You would be wanting to match from the end and use the $ sign. As Big'Guy is contains a ' we'll need to use %x to capture it.
I am also detecting a space after the period so I shall include it in my sample trigger:
#TRIGGER {(%x) is here. $} {#VAR BigGuy %1} |
|
|
|
JerzZzzZ Newbie
Joined: 30 Jun 2006 Posts: 3
|
Posted: Fri Jun 30, 2006 2:17 pm |
Ah shucks, uhm, I missed out another thing. Will be editting my first post, kindly help again. =x
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Jun 30, 2006 4:50 pm |
We have to figure out possibilities of (A) so we know to discard %1 is it is a (A). I'll add some color so you know if it is capturing.
#TRIGGER {(%x) (%x) is here. $} {#additem V_Titles %1;#additem V_Titles %2;#PSUB Yellow %x1;#PSUB Orange %x2}
You'll want to run that for a bit to get all the titles because as to distinguish the following two patterns:
(A) BIG'GUY is here. $
BIG'GUY LASTNAME is here. $
Once you think you have gotten all the titles, edit the variable V_Titles and remove all the BIG'GUY and LASTNAME names from it.
Then we use the trigger:
#TRIGGER {(%x) (%x) is here. $} {#IF (!%ismember(%1,@V_Titles)) {#VAR BigGuy %1} {#VAR BigGuy %2};#ECHO Deteremined BigGuy to be @BigGuy} |
|
|
|
JerzZzzZ Newbie
Joined: 30 Jun 2006 Posts: 3
|
Posted: Sat Jul 01, 2006 1:06 am |
M'kay, thanks a bunch! I think I got a good idea now =)
|
|
|
|
|
|