in reply to One regex construct to handle multiple string types

In case of input of "2L", \w* eats the "2". As input string does not have an optional dot, you are left with "L" as required by \S+, which is then printed.

Given the example strings, make preceding word letters AND the dot a single combination which is optional: m/ (?: \w+[.] )? (\S+) /x.