Hi David,
If you begin your pattern with '\v', then every character except [_a-z0-9]
becomes 'special'. This allows you to use tokens like '?', '(' and '+' without
a backslash. Unfortunately, you can't use '(?:' and friends.
Maybe there should be a modifier like '\v' which makes the pattern compatible
with PCRE. '\!' hasn't been taken yet, i.e., :s/\!(?:foo|bar)/---/
But this could potentially cause some headaches, because PCRE does not support
any of the Vim-only goodness such as \x\o\h\a\l\u\i\k etc (not to mention \%#
and \%c etc), and some items such as '\f' are ambigous? Vim treats it as any
file name character (from 'isfname') but PCRE treats it as the form-feed
character (\x0B I think). And then there is the question of where you want to
put the PCRE after-delimiter modifiers.
regards,
Peter
--- David Conrad <[EMAIL PROTECTED]> wrote:
> The regular expression syntax that Vim uses is, I'm sure, compatible with Vi.
> There were always a number of different regex dialects to choose from:
> grep, egrep, sed. But in the last few years, pcre's have become popular, and
> virtually standard across a lot of different languages, from Perl to Python
> to
> Ruby to JavaScript to C# to Java.
>
> Is there any way to use them in Vim? I've learned to used the Vim-style
> regex's
> in my s///'s, but if I could use one regex syntax across everything I
> work with, it
> would free up a few more brain cells for more constructive purposes.
>
> Any advice is appreciated.
>
> Thanks,
> David Conrad
>
Send instant messages to your online friends http://au.messenger.yahoo.com