httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodent of Unusual Size <Ken.C...@Golux.Com>
Subject Re: cvs commit: apache-1.3/src/helpers UpdateHide
Date Thu, 05 Mar 1998 12:49:31 GMT
Ralf S. Engelschall wrote:
> 
> In article <34FD56F2.7129B797@Golux.Com> you wrote:
> > Ralf S. Engelschall wrote:
> >>
> >>   -        next if ($name =~ m:^ap(_)|(api):);
> >>   +        next if ($name =~ m/^ap(?:_|api)/);
> 
> > I'm not going to veto, but I *am* going to complain: I find
> > this an UNimprovement.  IMO it makes things harder to read
> > rather than easier.  What's your point?
>
> Hmm... seems like either you are not such familiar with Perl regex ...

Not expertly familiar, no - and I can't find this syntax in the camel
book, either (just ?= and ?!).  As I said, I would rather a syntax
easily understandably by casual readers, not esoteric stuff that
does exactly the right thing but isn't obvious about it.

> Hmm... seems like either you are not such familiar with Perl regex or really
> wanted to match a different thing. I assumed here that you want to match the
> following types of symbols:
> 
>     ap_XXXX
>     apapi_XXX

Correct.

> My regex is _exactly_ the regex to match this _correctly. It doesn't even
> produce backrefs which are not needed (the "?:" stuff). Your regex
> 
>    1. creates two backreferences which are never used
>       (even for two constant items, the "_" and "api")

I explained this.  I'm using the parentheticals for regex grouping
and atomicy, not for back references.  Parens *do* have other
uses than just back references.

>    2. matches more functions:
>       ap_XXXX
>       XXXXapiXXXX

Excuse me?  How does "^ap(_)|(api)" match that?  The LH group should
bind more tightly to the alternation than the LH expression.  As I
said, further disambiguation in this syntax would be "^ap(_|(api))"
but I don't think that's necessary.

#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://WWW.Dummies.Com/

Mime
View raw message