in reply to Writing regexes, think ahead just a bit.

Lady_Aleena,
This is also an example of why writing modules to store commonly used code is far better than copy/paste strategies. I know it seems silly to write a function just to perform s/\.pl$// but if it had been, you could have fixed it once and all of the other code that used it (even the code you didn't remember writing) would have been fixed as well.

Regarding the humorous results of incorrect regexes - yes. I was writing a code that used OCR to parse bibiliographies from academic papers in the form of a PDF. I don't remember the exact details but due to the imperfect OCR process - there were a few journals that I would like to subscribe to if they were real ;-)

Cheers - L~R

  • Comment on Re: Writing regexes, think ahead just a bit.

Replies are listed 'Best First'.
Re^2: Writing regexes, think ahead just a bit.
by Lady_Aleena (Priest) on Mar 23, 2011 at 19:10 UTC

    L~R...the two regexes were in (separate) modules. After the first one, the second one was easy to figure out and find. I would love to see some of your results, but I have a feeling that they would be a bit difficult to reproduce and maybe even inappropriate. :)

    Have a cookie and a very nice day!
    Lady Aleena