https://kotlinlang.org logo
a

Ananiya

04/11/2021, 4:02 PM
Hello there :)
Copy code
kt
val thisIsATest = "**bold** normal **even bold** normal2"

"\\*\\*([\\s\\S]+?)\\*\\*(?!\\*)".toRegex().replace(thisIsTest,".").let{
println(it)
}
Is there any way to print like
Copy code
bash
.bold. normal .even bold. normal2
Instead of [the output from the above code]
Copy code
. normal . normal2
n

nanodeath

04/11/2021, 4:09 PM
try changing the replacement to
".$1."
a

Ananiya

04/11/2021, 4:14 PM
Thanks :)
2 Views