glor Beginner
Joined: 25 Feb 2003 Posts: 10
|
Posted: Tue Jun 15, 2004 2:56 pm
using %1, %2 with regex's |
Hey, I just had 2 quick questions about how to use the autoassigned variables when you have a regular expression involving a + or *. If had a trigger that fired on a regular expression like:
(?)+
The idea being, it matches on pretty much anything that has a single character or more. So let's say it recieves sometihng like "abcd". It would assign %1 = a, %2 = b, %3 = c, %4 = d. Let's say I want to loop through and make sure that each one is an 'a' (ya, i know, the regex could be changed to do that, but let's just say). Two questions here.
How do I loop through and check %1, %2, %3, %4 (ie. go through each variable, can I do like %@n and increment @n?)?
And how do I know when to stop (ie. so it doesn't go on to %5...%99)? Is there a way to tell how many variables were assigned?
Thanks guys!!+ |
|