String, broken by a specific condition
1 answer
\s+(?=\S*:)
You can split into this.
See demo.
https://regex101.com/r/hF7zZ1/4
Mostly use lookahead
to make sure the space
one on which the split follows non space characters and :
. So it will work the way you want it to.
+10
source to share