Regex.Replace("some big text", "^.+(big).+$", "$1"); // "big"
Regex.Replace("some small text", "^.+(big).+$", "$1"); // "some small text", but i need here empty string
I need to select a value from the string. It's ok, when the string matches the pattern. But when the string doesn't match, there is an original string in replacement result. I need an empty string, when string doesn't match pattern (only using replacement).