Subject: Re: regular expressions
From: Nuutti Kotivuori <naked@cs.hut.fi>
Date: Sat, 12 Jun 1999 AD 13:12:31 -0400

On 10 Jun 1999, Mirar wrote:

> > Um, sorry but I gotta post my loud opinion. I hardly ever write any regexp
> > without atleast one (?...) construct nowadays. They are a key to making
> > regexps elegant. Especially in the light of perl5.005 regexp (which PCRE
> > implements). Some of these things are beginning to get highly difficult to
> > implemet so I would very much recommend using an existing package like
> > PCRE. I could go on for hours how perl regexps make my life easier by
> > look-aheads, case-insensitivity in subexpressions, alternations and so on
> > that I'd hate to see Pike fail in this regard.
> 
> Is it a perl expression that follows the '?'?
> 
> A more elegant pike solution should be something like a callback to a
> pike function, maybe. I'm not exactly sure what '?' solves. Please
> give a concrete example.

Um, no - not by far. As the Perl Regular Expression man pages explain,
there are a number of (?...) constructs. To name a few:

(?#text)     A comment
(?:regexp)   Exactly like (), but doesn't make subfields
(?=regexp)   Zero-width positive lookahead assertion.
(?!regexp)   Zero-width negative lookahead assertion.
(?<=regexp)  Zero-width positive lookbehind assertion.
(?

Return to results