CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [tallamohan] Suggest any Regular Expression, Please: Edit Log



wickedxter
User

Aug 1, 2012, 2:26 PM


Views: 4351
Re: [tallamohan] Suggest any Regular Expression, Please


Code
 
my $var1 = 'abc';
my $var2 = 'xyz';
my $var3 = 'abcdexyz';

my @array = ($var1, $var2);
my @match = grep {$var3 =~ /$_/} @array;

print "This match was found $_" for @match;

This is what i came up with...


(This post was edited by wickedxter on Aug 1, 2012, 2:27 PM)


Edit Log:
Post edited by wickedxter (User) on Aug 1, 2012, 2:27 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives