Answers for "regex filter kotlin"

3

kotlin regex

"my string".matches(Regex("[a-z]+ [a-z]+")) // true
"my string".matches(Regex("my")) // false: must match whole string
Posted by: Guest on February-02-2021
0

kotlin regex

fun main()
{
    // Regex to match any string starting with 'a'
    // Regex para distinguir cualqueir string que empiece con 'a'
    val pattern = Regex("^a")
    println(pattern.containsMatchIn("abc"))
    println(pattern.containsMatchIn("bac"))
}
Posted by: Guest on February-17-2022

Code answers related to "regex filter kotlin"

Browse Popular Code Answers by Language