matchevaluator

How would I pass additional parameters to MatchEvaluator

I have a bit of code that looks like this: text = reg.Replace(text, new MatchEvaluator(MatchEvalStuff)); I need to pass in a 2nd parameter like this: text = reg.Replace(text, new MatchEvaluator(MatchEvalStuff, otherData)); Is this possible, and what would be the best way to do this? ...

The Unknown Exception DateTime C#

The data that I am sending to convertStringToDataSet function is <NewDataSet>\r\n <Table ID="Table1"> \r\n <PATNAME>Doe,JaneN</PATNAME>\r\n <LEVEL>175</LEVEL>\r\n <WHEN>2007-09-13T23:00:00.0000000-05:00</WHEN>\r\n <NOTE>New 180-day low -- ALERT: loss of 11.6 % in 123 days</NOTE>\r\n <IS_BAD>3...

Need help with RegEx for ranges

I want to be able to use a RegEx to parse out ranges like a Windows Print dialog (such as 1-50,100-110,111,112). The following is my current code and I am not clear on how to parse for the additional commas and numbers. I can parse out the hyphen, but not sure how to do it for additional commas or hyphens private void tboxRowNum_Leave(o...

How does MatchEvaluator works? ( C# regex replace)

This is the input string 23x * y34x2. I want to insert " * " (star surrounded by whitespaces) after every number followed by letter, and after every letter followed by number. So my input string would look like this: 23 * x * y * 34 * x * 2. This is the regex that does the job: @"\d(?=[a-z])|a-z". This is the function that I wrote that i...