Why do look-ahead and look-behind have to be fixed-width patterns?

From: inhahe (iseestars_at_gate.net)
Date: 01/28/05


Date: Thu, 27 Jan 2005 21:14:07 -0500

Hi i'm a newbie at this and probably always will be, so don't be surprised
if I don't know what i'm talking about.

but I don't understand why regex look-behinds (and look-aheads) have to be
fixed-width patterns.

i'm getting the impression that it's supposed to make searching
exponentially slower otherwise

but i just don't see how.

say i have the expression (?<=.*?:.*?:).*
all the engine has to do is search for .*?:.*?:.*, and then in each result,
find .*?:.*?: and return the string starting at the point just after the
length of the match.
no exponential time there, and even that is probably more inefficient than
it has to be.



Relevant Pages

  • Re: TAPI guide for dummies
    ... I also read that TAPI 3.1 does not work on win2k.....are ... > the fundamentals(unless I'm searching wrong) ... > the basics..then if I get stuck I resort to analyzing samples. ... > find any similar newbie seeking guidance posts ...
    (microsoft.public.win32.programmer.tapi)
  • Re: OSX encryption with a difference.
    ... painful searching and criticism associated with it. ... so of course I would NEVER criticism him, ... Now, I am what I like to think of as an "Advanced Newbie", who was been ... the discouraging remarks sent his way, and we will never hear from him ...
    (comp.sys.mac.system)
  • Removing the automatic macro for date
    ... I have tried searching the help and now the web. ... a little of a newbie, so I am having trouble. ... how to eliminate the function/macro of today's date when ...
    (microsoft.public.excel.worksheet.functions)
  • Formatting Cells to display Date: month/day/year
    ... I am a newbie when it comes to Excel and after doing some searching ... through threads I couldn't find the exact answer I needed so here ...
    (microsoft.public.excel.newusers)
  • Re: Why do look-ahead and look-behind have to be fixed-width patterns?
    ... inhahe wrote: ... > Hi i'm a newbie at this and probably always will be, ... > exponentially slower otherwise ...
    (comp.lang.python)