in reply to Re^4: Getting regular expression right
in thread Getting regular expression right

I guess that should be:
if ($_[0] =~ /^([^:]+):([^|]+)(?:\|(.*))?$/ || $_[0] =~ /^([^|])+\|(.*)$/) {