zomg regex

This is probably the most complicated thing I’ve ever had to work out in my entire life:

/^MK([1-9]|1[0-5]|17|19|77) [0-9]{1,2}[A-Z]{1,2}$/i

32 comments so far

  1. Mike Haddad said:
    On 22 Jul at 7:40 pm

    The hell is that?

  2. Lydia said:
    On 22 Jul at 7:54 pm

    Hey Jem.
    You probably won’t give this much thought, but one of your previous pant award receivers had her website hacked (it was Kate, I believe).

    The website’s homepage now looks somewhat demonic, and Kate’s visitors are all freaking out and blogging about it.

    ‘Pretty insane, if you ask me.

  3. Sarah said:
    On 22 Jul at 7:58 pm

    Wut?

  4. Stephanie said:
    On 22 Jul at 8:05 pm

    dewd. that looks so fun.

  5. Skye said:
    On 22 Jul at 8:18 pm

    O_O

    Uhm.

    Can’t help you there *hugs*

  6. Kaytlin said:
    On 22 Jul at 8:41 pm

    Meep.
    I guess that makes me a complete loser for not even having a guess what that even is, apart from it having something to do with coding. Good luck ^^

  7. Dave said:
    On 22 Jul at 9:36 pm

    umm…65. yeah, 65.

    :/

  8. Aaron said:
    On 22 Jul at 9:52 pm

    Uhm… lol?

  9. Arwen said:
    On 22 Jul at 11:13 pm

    Uh, what?

  10. Jabed said:
    On 22 Jul at 11:20 pm

    Hey Jem.
    You probably won’t give this much thought, but one of your previous pant award receivers had her website hacked (it was Kate, I believe).

    Yeah I just checked her site out, shame really, I kinda liked the site and she had some nice colouring tutorials. Maybe you could help her out Jem since you are a PHP ninja :)

    Good luck with whatever that coding jargon/problem/error that is.

  11. Bubs said:
    On 23 Jul at 12:23 am

    What is the regex for? You know I hate them :P

  12. Niki said:
    On 23 Jul at 2:08 am

    That looks like a new kind of 1337 talk.

    And that G3R1L1M dude might hax0r us all. Zomg.

  13. Vanesa said:
    On 23 Jul at 2:45 am

    I have no idea what that is. Honestly.

    “The website’s homepage now looks somewhat demonic, and Kate’s visitors are all freaking out and blogging about it.”

    Oh man! I just blogged about some guy in a blue shirt, and everyone else’s is blogging about the hack? I’m so lame. :(

  14. Shannon said:
    On 23 Jul at 2:51 am

    I love regular expressions. But my rusty knowledge is making me unsure. D:

  15. Mumblies said:
    On 23 Jul at 7:30 am

    /^MK([1-9]|1[0-5]|17|19|77) [0-9]{1,2}[A-Z]{1,2}$/i? Oh yes, of course….Hmmm why does this whooshing sound go off in my head? Beats me Jem

  16. Carly said:
    On 23 Jul at 9:00 am

    Pi. The answer is Pi.

    I know this, because Pie is the solution to everything, and in this case, a mathematical/program issue, pi must be the solution! Honest!

    e.g. Mathematical pi vs steak and kidney pie. You can see my logic.

  17. Carly said:
    On 23 Jul at 9:04 am

    re: the hacking of outspoken kate. Usually people get hacked for using unsecured, unstable and out of date scripts, having passwords that are easy to guess or giving out their information on-line. There might be other reasons too, those are the only I know…

    I suggest that Kate re uploads everything, and as Jem is always very quick to point out – make sure you are using stable, up-to-date scripts to run your site….

  18. Vera said:
    On 23 Jul at 10:57 am

    *goes cross-eyed* I tried… but then I decided that I can always google it :P Then again… since my router at home is pretty much dead I might… NAAAAAAAAAAH! I have some 5 chicklits to catch up with.

    Well, good luck! :-)

  19. Enzo said:
    On 23 Jul at 11:29 am

    *is happy that he’s only taking trigonometry and algebra 3*

  20. Rachael said:
    On 23 Jul at 1:45 pm

    /^ = half an emoticon?

    MK = Milton Keynes.

    ([1-9] = Think of a number between 1 and 9?

    Then I get stuck.

  21. Vasili said:
    On 23 Jul at 1:54 pm

    I know what it could match, but never what it would be used for.

  22. nerd. said:
    On 23 Jul at 2:01 pm

    Just a hunch, but it looks like a validator for a Milton Keynes post code.

  23. Grant said:
    On 23 Jul at 4:08 pm

    A php algorithm

  24. Dizzy said:
    On 23 Jul at 5:03 pm

    O_O I have no idea.

  25. Mumblies said:
    On 23 Jul at 6:27 pm

    A macro? Dunno, i fick lol

  26. Jem said:
    On 23 Jul at 7:05 pm

    Virtual cookies to Rachael and nerd; it is indeed a regular expression to match against a set of Milton Keynes postcodes (something I had to make for my course).

  27. Rachael said:
    On 23 Jul at 9:13 pm

    Woo!

    I used to have an MK postcode a few years ago, actually.

    MK18 FTW. I know MK42 is Bedford… MK8 is in MK somewhere. MK18 is Buckingham and surrounding villages… *geek*

  28. Melissa said:
    On 23 Jul at 10:12 pm

    And the question was “What is the meaning of life?” I take it?

    Over my head, whoosh.

  29. Jabed said:
    On 24 Jul at 10:22 am

    Virtual cookies to Rachael and nerd; it is indeed a regular expression to match against a set of Milton Keynes postcodes (something I had to make for my course).

    And now I know that I can sleep in peace knowing what the hell that PHPP jargon was. ^___^

  30. Chien Yee said:
    On 24 Jul at 11:37 am

    All I knew is that you need to put in MK in front :P

  31. Stepherz said:
    On 24 Jul at 7:53 pm

    That is hopefully something I’ll never see besides here….

  32. Poet Blogger said:
    On 25 Jul at 8:06 am

    I hate regex with a passion, well, kind of. If I can get it to work first try it is awesome, otherwise it is a pain in the butt. Main reason I hate it: the littlest thing can throw it off.