[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help needed with regexps
From: |
D. D. Brierton |
Subject: |
Re: Help needed with regexps |
Date: |
Fri, 13 Feb 2004 19:57:20 +0000 |
User-agent: |
Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) |
On Fri, 13 Feb 2004 19:37:32 +0000, Stefan Monnier wrote:
>> :front
>> "<style\\s-+\\(\\s-*.*\\s-+\\)*.*css\"?\\(\\s-*.*\\s-*\\)*\\s-*>"
>
> Regexps like A*.*B* are asking for trouble because there is an exponential
> numberof ways to match them and the regexp-engine uses backtracking.
> So it will get stuck trying them all, potentially for hours or even years.
> To you it just looks like "it's stuck".
Ah of course. I'm such a nincompoop sometimes. Removing the many .*s with
more specific expressions has solved the emacs tailspin problem. Thanks!
Best, Darren
--
======================================================================
D. D. Brierton darren@dzr-web.com www.dzr-web.com
Trying is the first step towards failure (Homer Simpson)
======================================================================