After spending some time figuring out how to find and replace multiple line content across multiple files, I figured that VS 08 that I'm using offer this functionality.
This functionality is very powerful due to regular expressions.
Regular expressions seem very confusing and complicated at the first glance, but are very very powerful.
Here is a sample of what I did:
//match thisprivate void Page_Load\(object sender, System.EventArgs e\)\n.*\{\n:b*if \(!IsAuthenticated\(\)\)\n:b*Server\.Transfer\(GetAppSetting\(GlobalConstants\.NOT_AUTHENTICATED_KEY\)\);Couple of things worth remembering:
1.
\n.* matches zero or more line breaks
2.
\ escape any special character as bracket (
3.
:b matches space or tab
//replace with thisif (!IsAuthenticated())\n\t\t\t\tServer.Transfer(GetAppSetting(GlobalConstants.NOT_AUTHENTICATED_KEY));\n\n\t\t\tUserRole role = GetUserRole();\n\t\t\tswitch (role)Hope I'll have more time to play with regular expression since this is extremely powerful concept.
Links:
1.
regex library cheat shit :-)2.
msdn regular expression builder