This particularly bad example of regular expressions and client side validation was originally published in 2009. I thought Australia was supposed to be upside down, not bass ackwards. - Remy

"The company I work for sells vacation packages for Australia," writes Nathan, "and for whatever reason, they're marketed under different two different brands — and — depending on whether you live Down Under or somewhere else in the world."

Nathan continues, "one of the requirements for the international website ( is to disallow people from within Australia and New Zealand to make bookings. But the way this is done from the front end... well, it's a real gem."

  *Checks to see if Australia is typed into the other country box
  function checkContactCountry(inputBox)
    var validator = new RegExp(
          |(N|n)(E|e)(W|w) (Z|z)(E|e)(A|a)(L|l)(A|a)(N|n)(D|d)$/);

         alert("Your Residential Address must be outside Australia. "
             + "Enter your residential address outside this country,"
             + "or visit to make a booking if "
             + " you live in Australia.");
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!