in reply to Parse colon-delimited data
Anyway... must this be a regular expression? Id' rather use split.
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.s/\s+$//; #remove trailing whitespace -- and newlines! my($name, $value) = split /\s*:\s*/, $_, 2;
|
|---|