John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

Where was that tool that analysed regex's and explained them automatically?

—John

Replies are listed 'Best First'.
Re: Understanding someone else's parser
by rob_au (Abbot) on Jan 02, 2003 at 03:10 UTC

      I also recall japhy noting that the base module doesn't yet support all the really funky things[1] you can do with regexen. It's really a string parser and in general parsing regexes also reduces to requiring a Perl parser in Perl that isn't perl.

      [1] - my definition of funky starts at (?{}) / (??{}) so maybe it's good for everything normal programmers use. ;-)


      Fun Fun Fun in the Fluffy Chair

        Here's the kind of stuff I'm looking at:
        while ( $line =~ s/([[:alpha:]][[:alpha:]\']{0,44})[_\-,\.\"\' +\)\?!:;\/&]{0,5}([ \t\n\r]|$)/ / ) { update_word($self,$1, $encoded, '', '[_\-,\.\"\'\)\?!:;\/ +&\t\n\r]') if (length $1 >= 3);
        The first line is what POPfile considers a "word", after dealing with some other special cases first. I want to tinker with this program a bit. So, there is nothing funky about it. Just someone else's code to read and understand.

        —John

Re: Understanding someone else's parser
by traveler (Parson) on Jan 02, 2003 at 16:16 UTC