I have a piece of code in c# that checks, if a value is a valid regex pattern.

Code is straight forward:

   try
   {
      System.Text.RegularExpressions.Regex.IsMatch("", pattern);
   }
   catch (Exception ex)
   {
       return "pattern matches must be a valid regex value";
   }

I'm trying to test if it works correctly, but I can't find an invalid regex pattern.

Any suggestions?

Edit
Report