Take the 2-minute tour ×

I am new to .NET regular expressions.

My regular expression below alerted too many ) at run time. I don't know how to handle the ()

input = "Get_MyAppList()";
Match match = Regex.Match(input, @"Get_([A-Za-z0-9\-]+)\()$", RegexOptions.IgnoreCase);
share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

You forgot to escape the last ) (just before the $):

share|improve this answer
add comment

get some regex tool that will help you create regexes that provides regex check on the fly with hints about mistakes whereabouts, generic error messages aren't good enough often.

I can recommend Expresso that I use, remember that most tricky stuff has to be preceded by


when you create regex (except letters & numbers basicly) so for "()" to match you need \(\)

share|improve this answer
add comment

Your Answer


