Regex extensions - siof/common.extensions GitHub Wiki
Regex extensions
IsValidRegex
bool IsValidRegex(this string pattern)
Checks if given pattern is valid regex. Checking is done in very simple way and will return false if:
- pattern will be empty
- or Regex.Match("", pattern) will throw exception
In any other case this function will return true.