in reply to how to split a string and take certain position?
($match) = $sentence =~ /([^:]+)$/ [download]
Your confusing two definitions of "last": "previous" and "ending".
+ means "one or more of the previous atom". $ (without the m option) means "end of string, or a line feed followed by the end of string".