Naresh Naresh - 1 year ago 104
C# Question

Regular expression to extract characters in between other characters

I have a string which is


And I need a regular expression to extract the character in between

Answer Source

Using RegEx:

Regex g;
Match m;
g = new Regex("//(.*)\n");  // if you have just alphabet characters replace .* with \w*
m = g.Match(input);
if (m.Success == true)
    output = m.Groups[1].Value;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download