([\w #]+) will get all the characters between the brackets and the extra spaces.
The problem I have your specification 'this kind of pattern' providing an inconsistent data sample makes it hard to discern what you actually want.
the idea of giving examples you should at least give an expected result.
either you think like a function
F(input) -> output
or at least some hint what the expectation of the result should be.
Btw in your case there are multiple solutions an they depend on scale, maybe regex is the wrong solution if you got a repeating pattern you can use cursor based buffer parsers packed into generators/coroutines.
j
stuff ;)
([\w #]+)will get all the characters between the brackets and the extra spaces.The problem I have your specification 'this kind of pattern' providing an inconsistent data sample makes it hard to discern what you actually want.
the idea of giving examples you should at least give an expected result. either you think like a function
or at least some hint what the expectation of the result should be.
Btw in your case there are multiple solutions an they depend on scale, maybe regex is the wrong solution if you got a repeating pattern you can use cursor based buffer parsers packed into generators/coroutines.