I currently have the regex '([^: ]+):([^ ]+)?', which when given a string like This is a correct:test msg: a b c bool:y returns [('correct', 'test'), ('msg', ''), ('bool', 'y')] (using pythons re.findall).
I actually want it to return something like [('correct', 'test'), ('msg', 'a b c'), ('bool', 'y')]. How do I force regex to look inside the second chunk, and see if theres a : in it?
You can use a positive lookahead on the second part, e.g.