News for hackers. Stuff that matters.
Re:RegExp Lookbehind Assertions by paulddraper on Tuesday March 01, 2016 @02:12AM (#11201207)
The Debian version format was not made to be easy.

https://www.debian.org/doc/debian-policy/ch-controlfields.ht...

But in any case, this works.

  ^(\d+:|(?!.*:))(?!.*-[^-]*:[^-]*$)\d(-?[A-Za-z0-9.+:~])*$
Actually, I think I variable-width lookbehind might be handy here to check the hyphens, but I don't have Chrome 49, so I'll forgo it.
Re:RegExp Lookbehind Assertions by mioelnir on Monday March 07, 2016 @08:56PM (#11243114)
I'd contend that it was "made" at all.

When I first looked at the relevant section of the policy manual, my takeaway was that they had a script that iteratively removed the leading and trailing optional fields, making use of the separators safe only if the fields were there so the script did not misfire.

They then took the runtime behavior of that existing script and called it the standard.