Search in sources :

Example 1 with MatchResult

use of kotlin.text.MatchResult in project kotlin by JetBrains.

the class KotlinIntegrationTestBase method normalizePath.

private static String normalizePath(String content, File baseDir, String pathId) {
    String contentWithRelativePaths = content.replace(baseDir.getAbsolutePath(), pathId);
    @Language("RegExp") String RELATIVE_PATH_WITH_MIXED_SEPARATOR = Regex.Companion.escape(pathId) + "[-.\\w/\\\\]*";
    return new Regex(RELATIVE_PATH_WITH_MIXED_SEPARATOR).replace(contentWithRelativePaths, new Function1<MatchResult, String>() {

        @Override
        public String invoke(MatchResult mr) {
            return FileUtil.toSystemIndependentName(mr.getValue());
        }
    });
}
Also used : Language(org.intellij.lang.annotations.Language) Regex(kotlin.text.Regex) MatchResult(kotlin.text.MatchResult)

Aggregations

MatchResult (kotlin.text.MatchResult)1 Regex (kotlin.text.Regex)1 Language (org.intellij.lang.annotations.Language)1