named groups splitting regardless of position of match
- by jeremy
Having a hard time explaining what I mean, so here is what I want to do
I want any sentenced to be parsed along the pattern of
text #something a few words [someothertext]
for this, the matching sentence would be
Jeremy is trying #20 times to [understand this]
And I would name 4 groups, as text, time, who, subtitle
However, I could also write
#20 Jeremy is trying [understand this] times to
and still get the tokens
#20
Jeremy is trying
times to
understand this
corresponding to the right groups
As long as the delimited tokens can separate the 2 text only tokens, I'm fine.
Is this even possible? I've tried a few regex's and failed miserably (am still experimenting but finding myself spending way too much time learning it)