Power of RegX Search/Replace in Visual Studio

I had real good challenge today. What I wanted was replace tons of method and put “_” at the end without manually going hundreds of rename.

So I tried power of RegX search/replace option

Here is full documentation about all available options

Open Search and Replace Dialog and then under Find Option Check “Use” and Select “Regular Expression”

Search For: {.}:Ps:Pe\s*\n
Replace With: \1_()\n

I will explain each part for SEARCH FOR regx
{.} mean any character
: Ps means opening bracket ( or {
: Pe means closing bracket ) or }
\s* means one or more whitespace
\n means new line

Here is breakdown of REPLACE WITH regx
\1 means anything from first curly bracket referenced in SEARCH FOR expression
_ means underscore
\n means new line

Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.

Leave a Reply