On 11/4/11 Fri Nov 4, 2011 12:56 PM, "Chris Stinemetz" <chrisstinem...@gmail.com> scribbled:
>> >> >> >> Try this: >> >> "Cell 999 CDM 1, 2, CBR 1, 15MHz, HEH" =~ /Cell\s*(\d+)\s*(.*),\s*HEH/; >> print "<$1> <$2>\n"; >> >> > > > Thank you Jim. This did the trick! Do you mind explaining how you did this? > I'm trying to make sense of it with my perl regex cheat sheet I found > online. > > http://www.erudil.com/preqr.pdf I don't think I could improve on the extended regex with comments posted by Shawn H. Corey. His regex is the same as mine, with the addition of a couple of '\b' assertions for matching word bounaries. Did you see that post? Each element of the regex must match some portion or condition in the string you are trying to match. The extended regular expression syntax like the one Shawn posted allows you to separate the elements with whitespace, making it easy to see the elements. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/