All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pinterest.ktlint.ruleset.standard.rules.internal.RegExIgnoringDiacriticsAndStrokesOnLetters.kt Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package com.pinterest.ktlint.ruleset.standard.rules.internal

/**
 * Transforms a string containing regular expression ranges like "A-Z" and "a-z" to a RegEx which checks whether a
 * unicode character has an uppercase versus a lowercase mapping to a letter. This function intents to keep the original
 * expression more readable
 */
internal fun String.regExIgnoringDiacriticsAndStrokesOnLetters() =
    replace("A-Z", "\\p{Lu}")
        .replace("a-z", "\\p{Ll}")
        .toRegex()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy