-
-
Save uburoiubu/6ef31c56573a74fe4e4c5709936c1d06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun extractPlaceholderData() { | |
val input = "{{product:12;k:13}}, {{product:14;k:15}}" | |
val regex = "\\{\\{.+:(.+);.+:(.+)}}".toRegex() | |
var result = regex.find(input) | |
result?.destructured?.let { | |
(first, second) -> println("$first : $second") | |
} | |
result = result?.next() | |
result?.destructured?.let { | |
(first, second) -> println("$first : $second") | |
} | |
} | |
// Output: | |
14 : 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment