views:

34

answers:

2

What is the reason for Visual Studio's Find & Replace dialog regular expressions not following standard regex syntax, e.g. using :b instead of \s?

A: 

Maybe for the same reason that Perl, Emacs, extended Regexps all have different 'standard' syntaxes (albeit mostly similar): they were all developed with different requirements. Emacs doesn't seem to offer \d for instance for matching numeric digits. (arguably \d isn't 'standard', but is reasonably widely supported, so one might think that is was standard)

There's support for bidirectional and other unicode characters offers more control than what's available in POSIX, plus there's the rather useful :i and :q as shortcuts for C/C++ identifiers and quoted strings. So the different syntax presumably grew out of the domain-specific requirements of VS.Net. More on the different things supported here.

I agree that it is an annoyance to have a different syntax, but I also find it annoying to remember to type [:digit:] rather than \d when I'm emacs.

the_mandrill
A: 

Hans is right, this is purely for backwards compatibility.

Oleg Tkachenko