Property | Value |
---|---|
Id | RCS1186 |
Category | Usage |
Default Severity | Hidden |
Enabled by Default | ✓ |
Supports Fade-Out | - |
Supports Fade-Out Analyzer | - |
private void Bar()
{
bool isMatch = Regex.IsMatch("abc", @"\w"); // RCS1186
}
private readonly Regex _regex = new Regex(@"\w");
private void Bar()
{
bool isMatch = _regex.IsMatch("abc");
}
[assembly: SuppressMessage("Usage", "RCS1186:Use Regex instance instead of static method.", Justification = "<Pending>")]
#pragma warning disable RCS1186 // Use Regex instance instead of static method.
#pragma warning restore RCS1186 // Use Regex instance instead of static method.
(Generated with DotMarkdown)