Check these out

Comments

  1. #1 James
    December 2, 2009

    I loved this bit on the page:

    “The grammar described in RFC 822 is suprisingly complex. Implementing validation with regular expressions somewhat pushes the limits of what it is sensible to do with regular expressions, although Perl copes well”

    Pushes the limits, indeed!

  2. #2 Sigmund
    December 2, 2009

    The tallest virtual building was easy.
    This video from the top of the tallest real building makes me queazy –
    http://www.wimp.com/toptallest/

  3. #3 skeeto
    December 2, 2009

    Claiming a virtual building to be the world’s tallest virtual building is the same as claiming a number to be the world’s largest number. It’s still a really cool idea they had there.

  4. #4 John McKay
    December 2, 2009

    I thought the gruesome expression would be President Palin, but I guess that’s more of a ewwwwsome expression.

  5. #5 Equisetum
    December 2, 2009

    James: I think that quote was nominated for understatement of the year.

  6. #6 WMDKitty
    December 2, 2009

    *clicks the first link*

    What the hell am I looking at, here?

  7. #7 Diane G.
    December 2, 2009

    4
    I thought the gruesome expression would be President Palin, but I guess that’s more of a ewwwwsome expression.

    Posted by: John McKay | December 2, 2009 12:40 PM

    Lol. I was thinking of “basket case,” which is pretty gruesome if you know the etymology…
    –Diane

  8. #8 Who Cares
    December 2, 2009

    What the hell am I looking at, here?

    Oh a ‘simple’ rule (written in Perl) that is used to look at an e-mail address and then see if it is allowed to be used.

    To explain what you see in more detail would require at least an entry level knowledge of regular expressions so that the different symbols used for the rules and text can be separated.

    Lets put it this way. I’ve had some experience with building expressions to insure that people don’t manage to stuff garbage into databases but trying to do more then just looking at this monster gives me a headache.

  9. #9 Gray Gaffer
    December 2, 2009

    I think what I find most disturbing about the Perl Regex is the state of mind one needs to achieve in order to even parse, let alone create, such a large expression. I have done my fair share of these things in my time, even implemented one or two (without back references, though) before discovering the library, and even moderate expressions require entering a state of mind completely antithetical to any kind of normal social interactions. Using regexes to validate email addresses in Javascript is a common task, but usually one leaves it to a simplified syntax checker like /^(([a-zA-Z0-9_\.\-+])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+(( *, *)|( +)|$))+/ . I’m guessing anything short of that massive example has to be not RFC822 compliant.

    Side note: while loading the big regex may be faster than parsing a recursive descent BNF definition, there is still a compilation stage involved: the perl regex library compiles the expression to a byte stream FSM, very similar in form and function to a classical Turing Machine implementation. Given the length of a typical email address string, the giant regex seems a little like overkill. Using perlmod (or equivalent) amortizes the BNF compilation over multiple such requests because the apache server maintains a compiled version of the code for server use, so I would guess the over-all server capacity might be higher with RecDescent than with the regex. Not that I’m about to test that hypothesis. The other argument against regex and for RecDescent is maintainability. BNF I can read without much mental immersion. Huge regex expressions? not so much.