[thelist] Write Only Perl Question...

Marty Landman marty at face2interface.com
Tue Aug 28 16:40:25 CDT 2001


At 04:49 PM 8/28/01 -0400, you wrote:

>if ($verify_new_users && $FORM{'action'} =~ /^\w{2}\d{7}$/) { ...bla bla bla }

Hi Mike.

I love this kind of stuff... is that cuz I'm left handed?

It says, if the variable $verify_new_users is set to a non-zero value (I 
think, I use 'and' myself)

and

if the value of $FORM{'action'} is two alphanumerics followed by 7 numerics 
then bla bla bla

^ means from the beginning
\w means a-z, A-Z, 0-9 (a word char)
{n} means n occurances of
\d means a digit
$ means at the end

RegEx' are admittedly a big pain in the butt to learn, at least I thought 
so. But they can be sooo cool once you get handle on them. Check out the 
Camel Book from O'Reilly when you get a chance.

hth,

Marty


Face 2 Interface Web Solutions
Website Creation Made SIMPL(tm)
http://face2interface.com/Home/Demo.shtml





More information about the thelist mailing list