Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nancy-tar/69bb37057db750a219a36c847383c6eb to your computer and use it in GitHub Desktop.
Save nancy-tar/69bb37057db750a219a36c847383c6eb to your computer and use it in GitHub Desktop.
C# regex to find words starting with certain symbol or character set
\B-\S*(?=\b|\|\W|\s|\r|\n|$) - finding words starting with "-" symbol. You can change it to any.
For example: @"\B" +"your symbol"+ @"\S*(?=\b|\|\W|\s|\r|\n|$)"
Check c# regex:http://regexstorm.net/tester
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment