title: Regex Match As Much As Possible Until The Next Match
body: <p>I have a text that comprises codes and texts for each code and it follows a certain pattern. I am trying to get the code and the text of each code by grouping each in a pattern, however, my pattern is matching the and returning 1 match and get the first code in one group and the rest of the whole text as the second group. What I am trying to achieve is for my second group to match as much as possible until it sees that the pattern has been repeated. I am using <a href="https://regex101.com/r/Ue30gq/2" rel="nofollow noreferrer">regex101</a> to fiddle with the pattern and see what I can work with, several options did not yield my results.</p>
  
  <p>In my pattern I specified that the code should be <code>([A-Z0-9]{1,6})</code>, I also tried specifying the codes that I will be using as follows <code>(ADD|DELETE)</code> but it still seems to match once.</p>
  
  <p>Can this be actually done or is my pattern obscure and not valid for my case? The pattern and text I am working on are included in the above link.</p>