What you've done wrong here, is passed your pattern through Regex.Escape
.
What this will do, is escape your brackets so your pattern will actually be @"\(st\)"
.
When working with Regular expressions, I like to use verbatim string literals.
This means you can write the pattern as you need, including backslashes.
Change your code to the following:
var regex = new Regex(@"(st)");
And your regular expression will match.
As an added bonus, using C#'s verbatim strings means you can copy-paste your pattern from sites like Regexr.com without worrying about escaping them.
Only becomes a problem when you're using quotes ("
), but even then there's ways around that are easy.
EDIT
If you're looking to match the word at it's boundary, you will need to use \b.
var regex = new Regex(@"(st\b)"); // Or remove the brackets entirely, up to you.
If you're looking to match a word beginning with the string, use \w
(for word).
Regexr.com has a great cheat sheet that's worth checking out.