aidanvii
10/30/2019, 2:42 PM{}
) with null, and empty lists ([]
) with null. The pattern is as follows:
Regex("""\{}|\[]""")
This compiles and works just fine in a unit test, but on android it crashes with:
Caused by: java.util.regex.PatternSyntaxException: Syntax error in regexp pattern near index 3
\{}|\[]
^
at java.util.regex.Pattern.compileImpl(Native Method)
at java.util.regex.Pattern.compile(Pattern.java:1344)
at java.util.regex.Pattern.<init>(Pattern.java:1328)
at java.util.regex.Pattern.compile(Pattern.java:950)
at kotlin.text.Regex.<init>(Regex.kt:89)
All I can surmise from this is that the underlying native implementation on Android is different.Rolando Lopez
10/30/2019, 2:50 PMaidanvii
10/30/2019, 2:54 PM{
"emptyObject" : {},
"nonEmptyObject" : {
"key" : "value"
}
"emptyList" : [],
"nonEmptyList" : [
"hello",
"world"
]
}
Rolando Lopez
10/30/2019, 3:04 PM