|Attention||Topic was automatically imported from the old Question2Answer platform.|
|Asked By||Gabriel Lima|
|Old Version||Published before Godot 3 was released.|
Hi, I’m trying to make a script to make the output of the Dictionary.to_json in a human readable JSON format, instead of the current single line output.
I’m currently stuck on finding only the commas that are not inside quotes. I found this RegEx that should be able to do this:
The example text is exactly my current test json in use.
Since Godot don’t work with regex literals, we have to escape some things and put inside quotes, so I believe I need this:
However, this is currently capturing all commas regardless of quotes, resulting on this newline on the wrong place:
Am I missing something or is there something broken with the RegEx? I tried searching issues on github and the Godot Q&A section and found nothing so far.
Thanks in advance, if I manage to find a solution I’ll post here.