in reply to Regex Validation
Readable solution, but scans entire string:
if (grep $_!=2, map length, /(:+)/g) { die } [download]
Stops at first error:
if (/: (?: :: | (?<!::)(?!:) )/x) { die } [download]