>> Does that work?
>> /\(\s\+\S*\)\@<=S
> 
> Variable-width lookbehind?
> How come vim does that(?) but perl dont!?

Because it's expensive ;-)  Per the docs at

   :help /\@<=        " is it just me or does that look
                      " like a duck eating an Oreo cookie?


   Theoretically these matches could start anywhere
   before this position.  But to limit the time
   needed, only the line where what follows matches
   is searched, and one line before that (if there
   is one).  This should be sufficient to match
   most things and not be too slow.

I suppose Perl could add a similar feature, but it's easy to 
abuse and get into some O(n^2) or O(2^n) backtracking hole (where 
"n" is based on the number of characters in the file previous to 
the match) and having it look like Vim (or perl) has locked up.

Yes, I use it in Vim, and yes I miss it in PCREs (though I'm not 
a perlmonger, Python's regexps are perlish and I miss them there).

-tim






--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to