perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Moss <martin_m...@btopenworld.com>
Subject Re: regex quickie
Date Thu, 26 Apr 2007 10:11:25 GMT
hmmmm seems this worked today.. Server restart musta
failed when it didn't seem to work..

if ($string =~ /($pattern_match)/i)


--- Martin Moss <martin_moss@btopenworld.com> wrote:

> 
> I'm looking for a regex which will help me do this..
> 
> $string = 'google.com/?q=test';
> 
> $pattern_match = 'google|yahoo|msn';
> 
> What I would like to do is test if $string contains
> one of the patterns in the pattern match and then
> carry out a function based upon which pattern is
> matched...
> 
> e.g.
> 
> if ($string =~ /$pattern_match/i)
> {
>    my $matched_pattern = ####???? ($_?)
> 
> 
> }
> 
> 
> Any ideas?
> 
> sorry for being slightly not mod perl specific...
> 
> 
>      
>
___________________________________________________________
> 
> Yahoo! Mail is the world's favourite email. Don't
> settle for less, sign up for
> your free account today
>
http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html
> 
> 



      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

Mime
View raw message