I\'ve noticed a lot of little debates about when to use regex and when to use a built in string function like String.Replace() (.NET).
It seems a lot of people recom
I think it's a wrong impression to use Regex as a catch-all solution when string based search/replace is possible.
Regex is instrinsically a process of pattern matching and should be used when the types of strings you want to match are variable or only conform to a particular pattern. For cases when a simple string search would suffice, I would always recommend using the in-built methods of the String class.
I have never seen any performance statistics suggesting that a Regex based lookup is faster or more performant than string indexing. Additionally, Regex engines vary in their execution capabilities.
As if that were not enough, it is quite easy to construct a Regex that performs quite badly (uses a lot of backtracking, for instance) so deep knowledge of Regex is required if you really want to optimize performance using Regex matching. On the other hand, it is quite simple even for a n00b to perform string based searches or replacements.