Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    Teh Fourth Drunken Coding Contest - Win 10 FTC (RegExp) \[OPEN\]

    Off-Topic
    2
    3
    1281
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Kevlar Spammer last edited by

      [b][i]“Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.”[/i][/b] [i]- Jamie Zawinski[/i]

      I’m drunk and writing code again… and watching my faaaaaaaaavorite movies! Man I love movies! The action, the adventure, the… action! Wow. I’m wasted.

      I stink your smart, and I’m betting your smart enough for this too! Wanna find out?

      I’m trying to find a regular expression (one that’s not constipated) that will match ALL of my favorite movie heroes, and NONE of the actors who played them.

      For instance, the regexp /att|ind/i matches Atticus Finch, and Indiana Jones, but not Gregory Peck or Harrison Ford.

      Now obvisisously you can cheat, and just | all the word together and ^ all the other words, but that’s no fun. So teh 10 FTC will go to the person who provides the SHORTEST regexp by this weekend, Saturday January 11th 2014, at 12:00PM PST. (holy crap, it’s 2014 already???)

      So, here’s da list of all my faaaaaavorite movie heroes:
      Atticus Finch
      Indiana Jones
      James Bond
      Rick Blaine
      Will Kane
      Clarice Starling
      Rocky Balboa
      Ellen Ripley
      George Bailey
      T. E. Lawrence
      Jefferson Smith
      Tom Joad
      Oskar Schindler
      Han Solo
      Harry Callahan
      Robin Hood
      Virgil Tibbs
      Butch Cassidy and the Sundance Kid
      Mahatma Gandhi
      Spartacus
      Terry Malloy
      Thelma Dickinson and Louise Sawyer
      Lou Gehrig
      Superman
      Juror #8
      Erin Brockovich
      Tarzan
      Obi-Wan Kenobi
      Frank Serpico
      Terminator
      General Maximus Decimus Meridius

      And here’s the list of the actors that played them:
      Gregory Peck
      Harrison Ford
      Sean Connery
      Humphrey Bogart
      Gary Cooper
      Jodie Foster
      Sylvester Stallone
      Sigourney Weaver
      James Stewart
      Peter O’Toole
      James Stewart
      Henry Fonda
      Liam Neeson
      Harrison Ford
      Clint Eastwood
      Errol Flynn
      Sidney Poitier
      Paul Newman and Robert Redford
      Ben Kingsley
      Kirk Douglas
      Marlon Brando
      Geena Davis and Susan Sarandon
      Gary Cooper
      Christopher Reeve
      Henry Fonda
      Julia Roberts
      Johnny Weissmuller
      Alec Guinness
      Al Pacino
      Arnold Schwarzenegger
      Russell Crowe

      Remember, you must match all the heroes, and none of the actors with a single regexp. Shortest one wins!

      Gooooooood luck, and stay drunk!!!

      1 Reply Last reply Reply Quote 0
      • P
        Plopsi last edited by

        Hihi I like this idea of a golf-contest…

        Just a little help:

        [url=http://jsfiddle.net/kmJFt/1/]http://jsfiddle.net/kmJFt/1/[/url]

        A JSFiddle which shuffles up the two arrays :) - so you can test it better.
        Note: You should copy the code (maybe to your “private” fiddle) and not adding your solution-code here. But feel free to improve the shuffle :)

        • Plopsi
        1 Reply Last reply Reply Quote 0
        • K
          Kevlar Spammer last edited by

          Less than 24 hours to go before the deadline! Will no one be brave enough to step forward?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post