in reply to Regex replacing Brackets with horizontal tabs and newliners

> without any modules.

You're going to write a JSON parser yourself. Without a parser, it's very hard to guess whether a newline should go after a comma - it might be part of a string or key, similarly brackets might appear in strings and commas. A double quote closes a string, but not if it's preceded by a backslash, unless the backslash is preceded by another backslash, etc.

Good luck.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]