the regex solution is terrible with bugs I don't know about.
Instead, use a toml parser:
https://github.com/mwanji/toml4j