public override fun parse()

in src/main/kotlin/com/pestphp/pest/configuration/PestVersionDetector.kt [26:39]


    public override fun parse(s: String): String {
        val version = if (s.startsWith("Pest")) {
            // for <2.0.0 versions
            s.removePrefix("Pest").substringBefore("\n").trim()
        } else {
            // for 2.* versions
            s.trim().removePrefix("Pest Testing Framework ").substringBeforeLast('.')
        }

        if (!version.matches(VERSION_REGEX)) {
            throw ExecutionException(PestBundle.message("PEST_CONFIGURATION_UI_CAN_NOT_PARSE_VERSION", s))
        }
        return version
    }