-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
  • 13,289
  • 28
  • 108
  • 198

1 Answers1

1

You could use

var found = Regex.Match(str,@"\$\([\s\S]+\)").Success;
Anu Viswan
  • 15,516
  • 2
  • 15
  • 40