[EMAIL PROTECTED] wrote:
> Bowie Bailey wrote:
> > Kenneth Porter wrote:
> > > Alternatively, is there regex syntax to match all patterns
> > > *except* the one given? Can I somehow express "all geocities.com
> > > subdomains except www and uk" as a regex?
> > 
> > That is a bit trickier because Perl does not currently support
> > variable length look-behinds.  But you can get around that by using
> > two separate look-behinds like this:
> > 
> >     /(?<!\bwww)(?<!\buk)\.geocities\.com/
> 
> In this specific case, this might suffice:
> /[^wu][^wk]\.geocities\.com/i

This is probably a less expensive regex, but it does not match quite
the same thing.  This will match any subdomain that does not end in
ww, wk, uw, or uk.

For instance, it will not match on "squawk.geocities.com".

> ... but this pattern does not generalize well.

True, but neither does mine once you get past two or three
alternatives.

-- 
Bowie

Reply via email to