Wizz Air and regular expressions

~ 25 Aug 2009, 01:43

Sometimes I wonder - is it just me, or this world is much more complicated and confused than it needs to be?

In short:

1) I'm booking an online ticket through the Wizz Air website. I have an account, so there's no traveler information I need to fill in;
2) The surprise comes in. I'm stuck at one of the pre-filled forms - when I press the "Next" button, a JavaScript window pops up and tells me I've entered an invalid phone number. Strangely enough, their system has had accepted the same phone number the previous time I booked a ticket;
3) After some experimentation, I realize that the system won't accept neither +35988XXXXXXX nor 0035988XXXXXXX (359 is the country-code of Bulgaria, btw). Weird, isn't it? I open the page's source code and search for the error message. So I arrive at the checkPhoneNumber function:

function checkPhoneNumber(num){
var filter = /^([0-9]){10,13}$/;
if (filter.test(num) || num == "")
return true;
return false;

4) Eureka! The regex says it all - they need a number with 10-13 digits inclusive. The country-code goes bye-bye.

In conclusion, one could to ask himself - will the average Joe, when being frown upon by this automatic System, know about the piles of source code which lay behind the funky web pages? Or that the "System" actually consists of a few screenfulls of simple code, written in an interpreted language? And within this code, it is the checkPhoneNumber function that does it all (ok, this may seem easy, but you could have been an Angolan, and do not know English at all)? And that the phone number is marked as valid if it's 10-13 digits, inclusive? More generally - the whole thing comes from one source after all, so why didn't they put a clarifying text like "(10-13 digits, please)" next to the input box? Even more generally - does it have to be such an elaborate and complex explanation to every simple problem in IT? And finally, why is this world so complex, anyway?

No comments

Contact: (Link to your blog/website/e-mail; not obligatory)
Your comment:

square root of(ninеtеen minus еightеen) = (type the answer in digits)


Valid XHTML 1.0 Strict