http://qs321.pair.com?node_id=726738

neversaint has asked for the wisdom of the Perl Monks concerning the following question:

Dear Masters,
Given these strings:
my $str1 = "2L"; # want to capture 2L my $str2 = "bar.2L"; #want to capture 2L
I want to create one regex construct that can capture the desired string as stated above. However my regex below doesn't seem to do the job.
while(<DATA>) { /\w*\.*(\S+)/; print "$1\n"; } __DATA__ 2L bar.2L
How can I get the correct one?

---
neversaint and everlastingly indebted.......