Lets say I have the following string:
Some crap string here...(TRACK "title1" F (S #h88 (P #m6) (P #m31)) (S #k3 (P #m58) (P #m58)))(TRACK "title2" P (S #a54 (P #r8)) (S #v59 (P #a25) (P #y82)))...Some other crap string here
Out of this string I need to extract to following data:
- title1
- F
- (S #h88 (P #m6) (P #m31)) and (S #k3 (P #m58) (P #m58))
and
- title2
- P
- (S #a54 (P #r8)) and (S #v59 (P #a25) (P #y82))
where
- is some kind of title.
- is some kind of status.
- is some kind of list of lists, like
(S #xx (P #xx))
.
Having limited regex knowledge, I can get 1 and 2, but only get the first part of 3.
(S #xx (P #xx))
can exist multiple times and also the inner (P #xx) can exist multiple times.
I've tried many regex expression and consulted a lot of posts, but I keep having troubles getting the data out as requested.
So now I'm back at \(TRACK "(.*?)" ([P|F]) (\(S.*?\)\))
which only captures the first of two lists in this example string.
see: https://regex101.com/r/FM0ZZR/1
What do I need to do to get all lists as described?