in reply to puzzled by pages

I can't tell from your description what you're trying to match. If you could give some examples of what the pattern should and should not match, that might help. Lacking that, I can only point you to perlretut, perlrequick, and perlre.

Replies are listed 'Best First'.
Re^2: puzzled by pages
by grashoper (Monk) on Jun 10, 2008 at 19:45 UTC
    product1name is always the same, I want to allow for 84 different prefixes to be checked they are always at least 3 characters the product1name is the end of the url I am checking, I need this to switch to a personalized login message depending on which url for the site visitors land on.

      Perhaps this pattern is what you need.

      $server_name =~ m{ \A # start of string .{1,3} # 1-3 characters \. # a literal period product1help\.com # literal 'product1help.com' }xms;

      If you want to know what the prefix matched actually was, use this:

      $server_name =~ m{ \A # start of string ( # start capture 1 .{1,3} # 1-3 characters ) # end capture 1 \. # a literal period product1help\.com # literal 'product1help.com' }xms; my $prefix = $1;
        I don't understand why this is not working, if my url is sef.mlxhelp.com it fails, if its www.mlxhelp.com it works.. what gives can anyone clarify why this fails? why does it even look at the prefix part?
        sub transform { if (!$Session->{'isAuthenticated'}) { if ($Request->ServerVariables("SERVER_NAME")->item()=~/(\mlxhelp +*)\.com/) { $Response->write("this is what I got $1"); $trns=$Server->MapPath("Transforms/pLogin.xsl"); return $trns; } if ($Request->ServerVariables("SERVER_NAME")->item()=~/(\tem +pohelp*)\.com/) { $Response->write("this is what I got $1"); $trns=$Server->MapPath("Transforms/tpLogin.xsl"); return $trns; } }