use strict; use warnings; my @strings = ( 'string that I need to gather the common base from: number 1 and some +other junk in it', 'string that I need to gather the common base from: number 2 and some +other junk in it', 'string that I need to gather the common base from: number 3 and some +other junk in it', 'string that doesnt meet the proper specifications: number 4 and some +other junk in it', 'another string that will fail to match: because it doesnt match DUH!' +, 'this string will fail as well' ); for(@strings){ print $1 . $2 . "\n" if (/^(string that I need to gather the commo +n base from:\s)(.*)/); }
In reply to Re: An efficient way to gather a common portion of several strings' beginnings
by james28909
in thread An efficient way to gather a common portion of several strings' beginnings
by igoryonya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |