|
jofu Beginner
Joined: 02 Nov 2003 Posts: 12 Location: USA
|
Posted: Mon Mar 22, 2004 6:54 am
#IF with =~ pattern expression |
If I have a %1 captured from a trigger which could look like this Apprentice Timmy, the great But it could also be virtually anything else. And I want a #IF to evaluate to true if Apprentice is in it, why isn't #IF (%1 =~ "Apprentice") {do stuff} working? Am I misunderstanding the use of patterns in expressions?
|
|
|
|
Mumra Wanderer
Joined: 12 Feb 2003 Posts: 93 Location: USA
|
Posted: Mon Mar 22, 2004 12:57 pm |
Now, I'm not a zmud guru, but it is probably possible to do something to the
effect of what you want, but If all you are trying to do is see if someone is an
Apprentice, couldn't you just use something like this?
#TR {Apprentice (%w),} {dotruestuff} {dofallstuff}
And accomplish the same thing? |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Mon Mar 22, 2004 3:17 pm |
If your trigger pattern is basically (*), try using quotes around your %1 to compare the entire string correctly.
#TRIGGER {(*)} {#IF ("%1" =~ "Apprentice") {do stuff}}
I'm sure that what you're doing is a bit different, but hopefully this helps. |
|
|
|
jofu Beginner
Joined: 02 Nov 2003 Posts: 12 Location: USA
|
Posted: Mon Mar 22, 2004 9:55 pm |
quote: Originally posted by Larkin
If your trigger pattern is basically (*), try using quotes around your %1 to compare the entire string correctly.
#TRIGGER {(*)} {#IF ("%1" =~ "Apprentice") {do stuff}}
I'm sure that what you're doing is a bit different, but hopefully this helps.
That was exactly it, quotes around the variable, just like a shell script *grin* thank you! |
|
|
|
|
|