14 Dec 2011

Visual Studio 2010 (VS2010) Javascript Function Folding - Code Region Outlining

I thought to myself, as I swam through an ASP.NET Razor View crammed with Javascript functions, 'SURELY someone has made a VS plugin that does function code folding?'.

Yup, Microsoft has. http://visualstudiogallery.msdn.microsoft.com/872d27ee-38c7-4a97-98dc-0d8a431cc2ed

9 Dec 2011

Visual Studio RegEx Regular Expression Cheat Sheet

Why MS decided to use a non-standard RegEx parser for Visual Studio 2010's Find/Replace controls, I don't know. All I do know is that I forget the syntax EVERY FRIGGING TIME in the heat of battle. So, here's the skinny:

Match group definition using CURLY BRACE {}
Match group replacement using BACKSLASH \

So to turn <bob.holness> to *bob* use:

FIND: \<{:a#}\>
REPLACE: *\1*

NOTE:

The :a is the VS alpha-numeric character match pattern
The # is the VS 'non-greedy' 1-or-more match pattern

BREAKING NEWS: Microsoft have come to their senses with VS2012 and use the standard .NET RegEx parser in the Find/Replace box now. Phew.





If I helped you out today, you can buy me a beer below. Cheers!