Kotlin Regex Match and Extract

December 4, 2019

Extract trailing number from time:1575473754

value = "time:1575473754"

val re = "time:(\\d+)".toRegex()

val timestamp = re.find(value)?.groupValues?.get(1)
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.