I have been trying to come up with a regex for the following string:
[1,null,"7. Mai 2017"],[2,"test","8. Mai 2018"],[3,"test","9. Mai 2019"]
I am trying to get as match output each bracket with its content as a single element like the following:
[1,null,"7. Mai 2017"]
[2,"test","8. Mai 2018"]
[3,"test","9. Mai 2019"]
My initial naive approach was something like this:
(\[[^d],.+\])+
However, the .+ rule is too general and ends up matching the whole line. Any hints?
[and]from the beginning and the end of the string would make this particular string JSON loadable withjson.loads()..r'\[[^]]*]'ast.literal_eval()nullwould probably need to be special-handled then..ast.literal_eval()works withNonebut don't works withNull..