Shabinder Singh
04/12/2023, 11:05 PMnma=function\\(\\w\\)(\\{.*?return b.join\\(\\\"\\\"\\)\\}\\;)
Compiled Pattern: nma=function\(\w\)(\{.*?return b.join\(\"\"\)\}\;)
Kotlin: v1.8.0
matching over text in js.txt.
all online regex matchers find this valid.
but kotlin is returning null, even documentation says it should compile to jvm pattern when run on jvm.
Not very much experience with regexs, any help is appreciated.Anonymike
04/13/2023, 12:00 AMimport java.io.File
val text = File("/home/perpetual/Downloads/js.txt").readText()
val regex = "nma=function\\(\\w\\)(\\{.*?return b.join\\(\\\"\\\"\\)\\}\\;)".toRegex()
// println(text)
regex.findAll(text).forEach {
println(it.value)
}
Shabinder Singh
04/13/2023, 1:09 AMAnonymike
04/13/2023, 4:37 AM