RGex Builder Platform - v1.2.0
    Preparing search index...

    Function calculateConfidence

    • Calculates a confidence score for a matched pattern. The score is adjusted based on whether a test value was provided, if it passed, and the complexity of the regex pattern itself.

      Parameters

      • baseScore: number

        The initial confidence score.

      • hasTestValue: boolean

        Whether a test value was provided.

      • testPassed: boolean

        Whether the test value passed the regex validation.

      • complexity: number = 1

        A multiplier for the pattern's complexity.

      Returns number

      The calculated confidence score, clamped between 0 and 1.