I am not able to match cyrillic strings in kotlin doing the following:
val regex = Regex(":\p{Cyrillic}*:") regex.find(any)
IDE shows word Cyrillic red and compiler says:
Unknown character property name {Cyrillic} near index 27
How to do this properly with kotlin?
You should use the In prefix, p{InCyrillic}:
In
p{InCyrillic}
val regex = Regex(":\p{InCyrillic}*:") println(regex.findAll(":Привет:...:Пока:").map{it.value}.joinToString() ) // => :Привет:, :Пока:
See the Kotlin demo
2.1m questions
2.1m answers
60 comments
57.0k users