Is there any difference in speed/memory usage for these two equivalent expressions:
Regex.IsMatch(Message, "1000")
Vs
Message.Contains("1000")
Any situations where one is better than other ?
The context of this question is as follows: I was making some changes to legacy code which contained the Regex expression to find whether a string is contained within another string. Being legacy code I did not make any changes to that and in the code review somebody suggested that Regex.IsMatch should be replaced by string.Contains. So I was wondering whether the change was worth making.