title: Parsing - Adding a capturing group
body: <p>I am attempting to use a fairly complex REGEX expression (see REGEX101 demos below), which I amended slightly from one created by an expert on this site. It parses specific patterns of log events:</p>
  
  <ul>
  <li><strong>1</strong>EXE_IN<strong>1</strong>EXE_CO<strong>2</strong>CONTENT_ACCESS<strong>3</strong>CONTENT_ACCESS</li>
  </ul>
  
  <p>These log sequences will always begin with a random selection of <code>EXE_IN</code> or <code>EXE_CO</code> events, preceded sequence numbers. These selections can be any number, in any order. In this case, we just have two <code>EXE</code> events but this may be 200. Or 1. Note that there is a sequence number and we need to capture it. </p>
  
  <p>The second part of the sequence will always be a series of digit-prefaced <code>CONTENT.ACCESS</code> events. Again from 1 to infinity in length.</p>
  
  <p>The following demo shows a working example and probably conveys the concept better than I can : <a href="https://regex101.com/r/m4UD0j/27" rel="nofollow noreferrer">Demo 1</a>  </p>
  
  <p>It nicely captures a full match, sequence number, and event in separate groups.</p>
  
  <p>I need to add a timestamp to the pattern (after the sequence number, with a preceding underscore), and then parse this event log e.g.</p>
  
  <ul>
  <li>1_11/08/2014 23:03EXE_IN1_11/08/2014 23:03EXE_CO2_12/08/2014 09:17CONTENT_ACCESS3_13/08/2014 09:17CONTENT_ACCESS</li>
  </ul>
  
  <p>I need to capture the timestamps as well.</p>
  
  <p>I attempted to adjust the regex expression, with mixed results. Please see this demo: <a href="https://regex101.com/r/m4UD0j/28" rel="nofollow noreferrer">demo2</a>  </p>
  
  <p>Ideally I'd like to see something like this for each event:</p>
  
  <pre><code>Match n
  Full match  266-308 `2_12/08/2014 09:17CONTENT_ACCESS`
  Group 1. 266-267    `2`
  Group 2. 268-284    `12/08/2014 09:17`
  Group 3. 284-308    `CONTENT_ACCESS`
  </code></pre>
  
  <p>I hope you can help me. REGEX101 pcre testing is sufficient <em>(for the record, I am using perl-compatible str_match_all_perl function in R)</em>.</p>
  
  <p>Many thanks in advance. </p>