Currently, I am doing search and replace using this pattern:
"(?<=\\{).+?(?=\\})"
. This finds everything inside curly brackets. (Courtesy of https://stackoverflow.com/a/8526268/1143917)
I use 'MatchEvaluator' with a delegate, so, when the input string is {this} is a {string}
, the delegate receives this
and string
.
This is not good for me because I want to replace both the matches and the curly brackets.
How do I change my regex expression so the delegate will receive matches with the curly brackets included, i.e. {this}
and {string}
?