0

Hi!!!

I am using following code in which I am generating the latex format.

Here I want to use the combination of characters[A-Za-z], numbers[0-9] ,special charactes(like π ,θ ,α ,β ,γ ,°,+, - ,×,÷,√ ,(,)etc) ,decimal numbers. For entering special characters I have used toolbar

Can anyone tell me how to create regular expression for above together.

The code which I am using is as follows:

```
const string matchNumerator = @"\((?<Numerator>[\d,]*(\.\d*)*)\)";
const string matchDenominator = @"\((?<Denominator>[\d,]*(\.\d*)*)\)";
const string matchBoth = matchNumerator + @"\/" + matchDenominator;
System.Text.RegularExpressions.Match m = System.Text.RegularExpressions.Regex.Match(input, matchBoth);
decimal dNumerator, dDenominator;
if (decimal.TryParse(m.Groups["Numerator"].Value, out dNumerator) && decimal.TryParse(m.Groups["Denominator"].Value, out dDenominator))
{
//and this right here is the string in latex format
string latex = @"\frac {" + dNumerator.ToString() + "}{" + dDenominator.ToString() + "}";
input = input.Remove(m.Index, m.Length);
input = input.Insert(m.Index, latex);
}
```

Kindly provide me solution...............