All pastes #167866 Raw Edit

Stuff

public text v1 · immutable
·published 2006-09-12 13:17 UTC
rendered paste body
# try to match path variables ..  such as /foo/bar and
# do not match /foo  bar

$a="/foo/bar";
$b="/foo bar";

if ($a =~ /(^\/[0-9a-zA-Z_])+/)
{
        print "$a is fine !\n";
}

if ($b =~ /(^\/[0-9a-zA-Z_])+/)
{
        print "$b is fine too !\n";
}


# I DO NOT WANT $b TO MATCH !! :(