Okay, this question was fun because it sent me on a Grindstone source code safari. Here we have the line that actually determines whether we have a match.
var match = Regex.Match(t.Name, "\\s*(" + customField.MatchPattern + ")\\s*", RegexOptions.IgnoreCase | RegexOptions.Singleline);
As you can see, your expression is both prefixed and suffixed so that it ignores surrounding white space and captures the match. In addition, we're always ignoring case and using single-line mode (just in case you were curious). Also, the format pattern (if present) is applied like this:
string value = match.Groups[1].Value;
if (customField.FormatPattern != null && customField.FormatPattern.Trim().Length > 0)
value = Regex.Replace(value, customField.MatchPattern, customField.FormatPattern, RegexOptions.IgnoreCase | RegexOptions.Singleline);
So, I'm assuming you're wanting to type a task like this: "Some Task (High)". And you want Grindstone to produce a task named "Some Task" and set the custom field's value to "High". In order to do that, you'd need to set the match pattern as something like \((?<p>High|Medium|Low)\) and the format pattern to something like ${p}. And obviously, if you don't want to type the parenthesis it becomes even simpler. For that all you need is a match pattern that's set to High|Medium|Low and no format pattern whatsoever.
One thing to note is that these are being done by .NET's regular expression engine, which may have a slightly different syntax for these format patterns than conventional regular expressions. I'll do some more research into that and if it turns out to be the case, I'll just zap a note over to UX so they can change the embedded user assistance in the Custom Field editor accordingly.
Thanks for one of the best questions I've had so far. 