I need to convert some old VB.net code to c#, and to speed things up I was planning to use regex.
For instance, in this piece of code:
if (Request.ServerVariables("SERVER_NAME").StartsWith("user"))
userS = true;
if (Request.ServerVariables("HTTP_X_ORIGINAL_URL") != null && Request.ServerVariables("HTTP_X_ORIGINAL_URL").StartsWith("/contai"))
UseContai = true;
I want to replace Request.ServerVariables("...")
with Request.ServerVariables["..."]
I tried using Request.ServerVariables("(.*)")
to match it, but it's not working. Any suggestions?