in reply to Parse colon-delimited data

This is a continuing story, isn't it? (Note to other users: bh_perl has written a few earlier threads on processing this or very similar data.)

Anyway... must this be a regular expression? Id' rather use split.

s/\s+$//; #remove trailing whitespace -- and newlines! my($name, $value) = split /\s*:\s*/, $_, 2;
The 2 as a third argument to split prevents the value from getting broken up in case it contains a colon, as split now always will split into two parts: the name, and the value.