On 11/4/11 Fri Nov 4, 2011 10:42 AM, "Chris Stinemetz" <chrisstinem...@gmail.com> scribbled:
> I am trying to match a line that has HEH in it. > > I would also like to store the number follow CELL in memory variable $1 > and store everything following the number and upto excluding ", HEH" in > memory variable $2 > > so this line: > > Cell 999 CDM 1, 2, CBR 1, 15MHz, HEH > will equal: > > $1 = 999 > $2 = CDM 1, 2, CBR 1, 15MHz Try this: "Cell 999 CDM 1, 2, CBR 1, 15MHz, HEH" =~ /Cell\s*(\d+)\s*(.*),\s*HEH/; print "<$1> <$2>\n"; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/