I've noticed some code that uses the static method:
Regex.IsMatch([someRegexStr], [someInputStr])
Is it worth replacing it with the instance method? Like:
private readonly Regex myRegex = new Regex([someRegexStr]);
...
myRegex.IsMatch([someInputStr]);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…