override fun doValidate()

in src/main/kotlin/com/intellij/internal/statistic/eventLog/validator/rules/impl/RegexpValidationRule.kt [15:26]


  override fun doValidate(data: String, context: EventContext): ValidationResultType {
    val pattern: Pattern = myPattern ?: return ValidationResultType.INCORRECT_RULE
    val escaped: String = StatisticsEventEscaper.escapeEventIdOrFieldValue(data)
    if (pattern.matcher(escaped).matches()) {
      return ValidationResultType.ACCEPTED
    }

    // for backward compatibility with rules created before allowed symbols were changed
    val legacyData = StatisticsEventEscaper.cleanupForLegacyRulesIfNeeded(escaped)
    return if (legacyData != null && pattern.matcher(legacyData).matches()) ValidationResultType.ACCEPTED
    else ValidationResultType.REJECTED
  }