Skip to content

Instantly share code, notes, and snippets.

@dgroft
Created July 9, 2014 18:36
Show Gist options
  • Save dgroft/dfb6db932ad93b4c26b3 to your computer and use it in GitHub Desktop.
Save dgroft/dfb6db932ad93b4c26b3 to your computer and use it in GitHub Desktop.
Extract contents between parens in a string using RegEx
// fetch "grab this part!"
Regex.Match("blah blah (grab this part!)", @"\(([^)]*)\)").Groups[1].Value
// source: http://stackoverflow.com/questions/378415/how-do-i-extract-a-string-of-text-that-lies-between-two-parenthesis-using-net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment