Using variables in REs

2004-12-16 Thread Michael Kraus
G'day... I've got a function which checks that only allowed characters are contained within a tainted piece of data, part of it looks like this: if ($tainted =~ /^([$allowed_chars]*)$/) { return $1; } Where $allowed_chars are the allowed characters. Questi

Re: Using variables in REs

2004-12-17 Thread Ing. Branislav Gerzo
Michael Kraus [MK], on Friday, December 17, 2004 at 11:33 (+1100) has on mind: MK> How are they interpreted? (Would the "\" just escape the next character MK> appearing or would it be interpreted literally? I'm guessing the former, MK> as I'm pretty sure I can use "\d" to indicate a digit.) try