Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The U.K. government does this a ton with random reference numbers, even on their new (mostly good) sites and it drives me up the wall. Oftentimes they will give you these numbers with spaces but the form will not let you enter it with spaces (so it will fail if you copy-paste), or even worse the form will have a size limit so if you paste your 10 digit number with two spaces, the last two digits will be chopped off so it will fail again when you remove the spaces.

Another problem is phone numbers: if you want to use some autofill functionality, your phone number will often include the country code part but the field won’t allow a + (maybe in this case the autofill feature should drop the country code (and add a 0) or replace the + with 00).

I’m not actually sure about the significance of the space in U.K. postcodes. I feel like it shouldn’t be significant as one can imagine a regex for the two parts, /([A-Z]+[0-9]+)\s*([0-9][A-Z]+)/, but I then there are exceptions like EC1R.



My favorite is a video cutter software that has two four-sectioned inputs for start/end times, like hh:mm:ss.ttt. You enter e.g. 00:17:44.500 into “start”, deleting minutes section with DEL, because it’s full with zeroes. And then you can’t enter 17 into end-minutes field, because video length is 21:30 and 17:30 is less than 17:44.500, which is bad. You have to first del-fix end-seconds and then go back to minutes. But wait, you want to cut to 17:50, but 21:50 is more than the video length (21:30), so as you type 50 it makes it into obvious 05! You have to del-fix minutes to 20, del-fix seconds to 50 (now you’re half-good), go back to minutes and del-fix these to 17. Milliseconds are no-brainer from there, don’t worry (but do not forget to unfocus the input, because otherwise it doesn’t apply). Sadly it still cuts along nearest keyframes only, but hey, at least it works.

If you think that I’m just kidding, it’s Gihosoft Video Cutter, one of 10 best video cutters out there.


Here is the official UK postcode regex:

  ^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) [0-9][A-Za-z]{2})$
The second part is always 3 characters. The first part can be 2, 3 or 4 (B1, B30, SW2, SW11, EC1A).


Dvla... They ask you to enter the number on your form, without a prefix that is printed on it, and then to enter the payment amount that you think you owe them. No confirmation, no validation...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: