muliyul
01/13/2021, 12:22 AM[html...] SwaggerUIBundle({ ... }) // the object I'm trying to replace is the parameter to this factory
[...html]
The object may have indentation, new lines etc.
I came up with this:
html.replace("""\s*\{(\s*.*)*}\s*?""".toRegex(), myJsonFormattedString)
But since the expression resides between js brackets the regex is matching all the way to the closing bracket for example:
{ ... }) [...javascript] }
I tried to use the non-greedy modifier but it didn't seem to work.
Your help is appreciated!Matteo Mirk
01/13/2021, 11:14 AM