Joe White’s Blog

Life, .NET, and Cats


*Real* regex search-and-replace in Visual Studio

niugang just posted some very cool code on CodeProject: a Visual Studio add-in that gives you real regex search and replace.

It’s long annoyed me that Visual Studio’s regex support is so weird. They have a lot of the features, but their syntax is truly, truly warped. ({} for captures? @ and # and ^ for quantifiers? Needing to either roll a manual character class, or else understand the full Unicode spec, just to do something simple like \w?) And they’re missing some of the most interesting and useful features, like lookbehind and positive lookahead. Which is silly, because they have full-fledged Perl-compatible regular expressions sitting right there in the Framework.

Okay. Enough ranting. This add-in should be way cool. Unfortunately, niugang had to create all new UI, since there was no way to reuse the standard Visual Studio search and replace dialogs. This probably means some of the fancier features are missing (I suspect that I won’t be able to select two different directories and tell it to search them both, for example). But even so, I’m very much looking forward to real regexes in VS. And hey, it’s got source code.

Now someone just needs to write a real regex search-and-replace for Delphi…

There are no responses to “*Real* regex search-and-replace in Visual Studio” yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Joe White's Blog copyright © 2004-2011. Portions of the site layout use Yahoo! YUI Reset, Fonts, and Grids.
Proudly powered by WordPress. Entries (RSS) and Comments (RSS). Privacy policy