I searched ... and searched...I don't mean Can I test if a regex is valid, I want to test if a replacement
string needs to be used in Regex.Replace or is a simple String.Replace going to give me the same result, only faster.
ie. for a given string replacement
do I need to use
Regex.Replace(input, replacement)
instead of
string.Replace(input, replacement)
This assumes (always a great idea) that string.Replace is faster than Regex.Replace.
edit: yes, a great idea. Not. Regex.IsMatch vs string.Contains for one.
Leaving this here as an example of premature optimization. As with most things in life - "It depends". I think that if you had hundreds or thousands of patterns then it may be worth sifting out the simple ones, depending on the likelihood of there being simple ones. For a manageable number of patterns, just do the Regex.