code: function verify(context, node, pattern, flags) {
      try {
          let found = false
  
          new RegExpValidator({
              onCapturingGroupEnter(_start, name) {
                  if (name) {
                      found = true
                  }
              },
              onBackreference(_start, _end, ref) {
                  if (typeof ref === "string") {
                      found = true
                  }
              },
          }).validatePattern(pattern, 0, pattern.length, flags.includes("u"))
  
          if (found) {
              context.report({ node, messageId: "forbidden" })
          }
      } catch (error) {
          //istanbul ignore else
          if (error.message.startsWith("Invalid regular expression:")) {
              return
          }
          //istanbul ignore next
          throw error
      }
  }
docs: Verify a given regular expression.
  @param {RuleContext} context The rule context to report.
  @param {Node} node The AST node to report.
  @param {string} pattern The pattern part of a RegExp.
  @param {string} flags The flags part of a RegExp.
  @returns {void}