Let's take this line for example:
This is a [13125] string and [9414] it's long. [123897] it's longer [38153] than an average [73941].
How do I match entire line and group every occurence of [number] and everything in between?
I have this regex so far: /(.*)(\[\d*\])(.*)/. It works as intended but only groups the last occurrence of [number]. I want it to do something like this:
Group 1: This is a
Group 2: [13125]
Group 3: string and
Group 4: [9414]
...