> 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
That's because of the underlying theory of regular expressions. They are
modelled using so call
John Machin wrote:
To grab the text after the 2nd colon (if indeed there are two or more),
it's much simpler to do this:
import re
q = re.compile(r'.*?:.*?:(.*)').search
def grab(s):
...m = q(s)
...if m:
... print m.group(1)
...else:
... print 'not found!'
...
grab('')
not f
inhahe wrote:
> 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 sear
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