Anne van Kesteren

T-Mobile and validation

Jorgen told me yesterday about an excellent offer from T-Mobile. Switch from your prepaid account to their "Relax 300 SIM" and pay about six euro for 300 minutes a month. Now I do not use my mobile phone that much but I do pay more than six euro for less minutes. Usually I spend about twenty euro a month or so.

So I went to T-Mobile.nl and tried to sign up. Apparently my passport document number was incorrect. I checked again. And again. Then I checked their regular expression. It was hidden in some file, but I eventually found:

var reg1 = /^[NMZDSnmzds]{1}[0-9]{8}$/;

It happens to be that my document number starts with NJ... O well. (Quite cool that regular expressions are a native data type by the way. Makes me remember E4X which introduces XML as a data type.)