-1

I am looking for a regex that would search a string for occurrences of substring with the pattern $(...). So basically anything wrapped around with $(). So the string

string str = "Hello $(item)"

would result true for that substring because it contains $(item) My question is how do I regex check for wrapped up items with $(xx) in C#?

MistyD
  • 14,915
  • 32
  • 126
  • 215

1 Answers1

1

You could use

var found = Regex.Match(str,@"\$\([\s\S]+\)").Success;
Anu Viswan
  • 16,800
  • 2
  • 18
  • 44