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
1.4m articles
1.4m replys
5 comments
57.0k users