in reply to One regex construct to handle multiple string types
works for me.while(<DATA>) { /(.*\.)?(\S+)/; print "$2\n"; } __DATA__ 2L bar.2L bar.ber.bir. 2L bar.ber.bir.2L
The above reads your request as "get the first substring part not containing whitespaces that follows the last dot char (if there is one) in the input string; otherwise, return the first substring part of the input string that doesn't contain whitespace".
Hope that helps.
Krambambuli
---
In Section
Seekers of Perl Wisdom