I have
Console.WriteLine(Regex.Match("<Anything1>Manadatory=Optional<Anything2>",
@"(?<M>.+?)[ \t]*?(?<O>=Optional)?"
).Groups["O"].Value);
Presence of '=Optional' is optional. I'd expect that if I have '?' next to its pattern, that string will be matched but instead of it empty string is matched. How can I write a pattern so =Optional is matched if it is there and O group is empty if =Optional isn't there ?
Thanks