|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Wed Nov 16, 2005 5:25 am
help with pattern |
this is the pattern im trying to use
~(~A~)(*)
#if (%1 != @mob) {#var mob 1}
basically, i want the var mob to be set to 1 if %1 doesn't match @mob, but @mob can be 7 words with ()/, ect. so i tried to put "" around @mob, didnt work. i tried using =~ without any luck. origianlly i had %w in the pattern, but since that only matched the first word, something like -=-=\name would trip it up so i switched to a *. |
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Wed Nov 16, 2005 7:39 am |
Have you tried quotes around the %1 ?
#IF ("%1" != @mob) {#VAR mob 1}
Syntax Colourizer |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Wed Nov 16, 2005 5:00 pm |
but then wouldn't it just check for "%1" instead of what was captured?
|
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Wed Nov 16, 2005 5:10 pm |
"%1" means that it will take 1 word or 1,000,000,000 words.
it's like a capture all in between thing |
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Thu Nov 17, 2005 6:20 am |
Yep. The quotes make sure mutliple info is grouped together into the %1 paramter. Otherwise, when you check the parameter it may only return the first item in the parameter instead of everything.
|
|
|
|
|
|