[oak perl] Most Annoying thread about regexes?

Belden Lyman blyman at iii.com
Tue Apr 6 16:18:06 CDT 2004


On Tue, 2004-04-06 at 12:22, George Woolley wrote:
> On Tuesday 06 April 2004 10:06 am, David Fetter wrote:
> > On Mon, Apr 05, 2004 at 10:59:13PM -0700, George Woolley wrote:
> > > On Monday 05 April 2004 3:09 pm, David Fetter wrote:
> > > > On Mon, Apr 05, 2004 at 03:13:12PM -0700, George Woolley wrote:
> > > > > What's the most annoying regex you've encountered?
> > > >
> > > > Anything that doesn't fit on one line.   After that, they're all
> > > > equally annoying, and don't belong in production code. :)
> > > >
> > > > Cheers,
> > > > D
> > >
> > > David,
> > > Thanks for the provocative response.
> > >
> > > Based on your response, my understanding is that your position is
> > > that there are no production environments in which which it is ever
> > > appropriate to use regular expressions in production code.
> > > Is that your view?
> >
> > I don't know how you managed to get that out of what I said.  In my
> > experience, *complicated* regexes don't belong in production code.
> > Multiple simple ones are a lot easier to code, debug, &c.
> >
> > Cheers,
> > D
> 
> David,
> 
> Oh, good. 
> I'm glad that your position isn't
> that no regexes belong in production code.
> 
> You seem uncertain how I managed to understand you to be saying
> that no regexes belong in production code.
> Here's how:
> * Because of the context I interpreted "they're all"
> to be referring to "all regexes".
> * I thought you were continuing with the same topic
> in the second half of that sentence
> (which has no explicit subject).
> * That led me to interpret it as something like
> "all regexes don't belong in production code"
> or an unqualified "No regexes belong in production code".
> Hope that clarifies how I managed to get that out of what you said.
> 
> I haven't so far come up with an alternate interpretation.
> Hence I would be most interested in your interpretation
> of your own words.
> 

How about how someone else interpreted David's words?

Here's what was written:

   George: What's the most annoying regex you've encountered?

   David: Anything that doesn't fit on one line.   After that, they're 
          all equally annoying, and don't belong in production code. :)

I took David to mean:

"The most annoying regex I've encountered is anything that doesn't fit 
on one line. The set of regular expressions which is longer than a
line's length is an annoying set, none of whose members belong in
production code."

Perhaps missed by other readers, David further implies the existence of 
a single regular expression which proves that the aforementioned set is 
finite. But lacking the space in his margin to scribble the tantalizing 
regex, we are simply left with Fetter's Enigma.

> Anyway, I do now understand 
> that you do not take the position 
> that no regexes belong in production code.
> 

There is a certain school of thought which contends that only production
code belongs in production code. Superfluous drapery- error messages,
regular expressions, SQL statements, HTML templates, javascript, and so
on should all be removed from production code. See Class::Phrasebook,
Parse::RecDescent, and your templating module of choice. If you want to
remove production code from your production code, see also Acme::Bleach.

Belden

> George
> 
> P.S. Thanks for not deleting the earlier parts of the thread
> in your post.
> It makes discussion much easier.
> 




More information about the Oakland mailing list