Re: regexp BUG in multiple GUI text editing programs
On 23 Aug 2001 16:16:09 +1000, Anthony Towns wrote:
> On Thu, Aug 23, 2001 at 06:08:09PM +1200, Adam Warner wrote:
> > Try and replace the tags with "hello" (no quotes) using this regexp:
> > <.*?>
> > [The "?" is supposed to make the any character matching non-greedy].
>
> Regexps vary. Using the "?" in that way is a Perl regexp thing, iirc, and
> can't be relied on everywhere. Use "<[^>]*>" if you want to be sure.
Oops. I should have asked you guys first!
Well it's a pity that regexps vary. Thanks for the tip. I wasn't aware
that the use of a question mark was non-standard. I was looking at the
Python Regular Expression HOWTO at the time, but I remember using it
previously with a Perl-orientated regexp HOWTO as well.
This also explains why I didn't find other bug reports :-)
Regards,
Adam
Reply to: