• Frist (unregistered)

    frist for the frist time?

  • Will Kirkby (github)

    surely you mean /^(F|f)(R|r)(I|i)(S|s)(T|t)$/

  • Ron Fox (google)

    TRWTF is that this REGEXP is readable.

  • isthisunique (unregistered)

    This brings me back to the horrors of creating offensive word filters for forums.

    Now that was some regex. Pages of the stuff.

  • Ingo (unregistered)

    That could be written much more readable:

    /(australia)|(australiA)|(australIa)|(austraLia)|(austrAlia)|...

  • RichP (unregistered) in reply to Ron Fox

    Readable? That's how you know it's an invalid regex...

  • SlightlyD (unregistered)

    And if we entered it's official name of "Commonwealth of Australia", can we get the deal?

  • Kevin Jordan (google)

    TRWTF is that they didn't use a combobox for the country.

  • Squigly (unregistered)

    I love how the function just returns without returning false. Looks like it will just allow you to post Australia anyways.

  • Herby (unregistered)

    In its own way, the script "works". It was probably written to some very specific requirements document (probably the greater WTF!). But it "works", and as the saying goes: "If it works it is aesthetic." (no matter how awful the implementation).

    It probably remained in production because someone said "If it works don't fix it!" (TRWTF!).

  • (nodebb) in reply to SlightlyD

    Yep. Definitely a different place, that one. Also, "New Zealand" or "Australia " and even " Australia".

    Addendum 2016-07-06 14:42: The comment actually trimmed the double space in "New Zealand". There is supposed to be double space there.

    Maybe their system also had that?

  • Garmoran (unregistered)

    Another of these geographical conundrums that some websites present, designed to irritate New Zealanders bigtime, I expect: New Zealand _is_outside Australia. UK residents in Northern Scotland have similar problems: many British courier companies insist that the region does not form part of the "UK Mainland", regardless of what cartography might show.

  • foxyshadis (unregistered)

    Apparently they want people who use the wrong site to emigrate, since all it does is pop up a box to tell you to go elsewhere (no link! better memorize it!) and then focus on the country so you can change their address. Was it really too hard to just redirect to the other site?

  • foxyshadis (unregistered) in reply to Garmoran

    You think that's bad, tell some Catholic Dubliners in a pub how they're the greatest Brits you've ever met. Or for bonus glassing, the greatest Englishmen.

  • Just Me (unregistered) in reply to Ingo

    If you want to go through a large number of cases 2^9 + 2^10

  • I dunno LOL ¯\(°_o)/¯ (unregistered)

    TRWTF is that it doesn't reject "ɐᴉlɐɹʇsn∀".

  • This is a fat lie it's from a lecture on bad coding practices (unregistered)

    Read the below pdf, page 6.

    http://stg-tud.github.io/eise/WS11-EiSE-08-Software_Quality.pdf

  • Anon (unregistered) in reply to This is a fat lie it's from a lecture on bad coding practices

    Wow, the pdf they ripped it from even has a screencap of thedailywtf.com. I don't know how they thought no one would notice.

  • Matt Westwood (unregistered)

    So TRWTF is the shoddy formatting of the spacing between the words in the alert due to lack of care where the substrings are joined together, yeah?

  • (nodebb)

    Love the bug in the anchoring.

  • Damien (unregistered) in reply to This is a fat lie it's from a lecture on bad coding practices

    So, when they originally posted this in 2009, they were ripping off a PDF that, by all indications was written at least later than 2010, probably 2011 by its naming. Interesting theory.

  • Katrina Swales (unregistered) in reply to This is a fat lie it's from a lecture on bad coding practices

    That pdf's examples all seem to come from thedailywtf ... bear in mind according to the site, http://stg-tud.github.io/eise/ it was published in at most 2011/12 private bool trueandorfalse(bool _booInpt) - http://thedailywtf.com/articles/The-Clever-Coder function checkContactCountry(inputBox) - http://thedailywtf.com/articles/RegExp-From-Down-Under

  • (nodebb) in reply to Garmoran

    There are a bunch of economic treaties between Australia and NZ that go partway to making a common market out of them. There's nothing stopping an Australian buying or renting property across the Tasman and using that as their residential address; pop over every couple of weeks or so to pick up the mail.

    (On-topic aspect left as exercise for the reader)

  • (nodebb)

    The biggest fail is the message. Even from here in USA I can hear New Zealanders screaming, "I don't live in Australia you ________!"

  • Garmoran (unregistered) in reply to BatConley

    Agreed. This is what I was attempting to convey in my previous post. Not sure I succeeded.

  • (nodebb)

    Wow, they hadn't even heard of character classes.

Leave a comment on “Classic WTF: RegExp from Down Under”

Log In or post as a guest

Replying to comment #:

« Return to Article