title: Combining regex with a literal string
body: <p>I have the following code:</p>
  
  <pre><code>input &lt;- "1-FA-1-I2-1-I2-1-I2-1-EX-1-I2-1-I3-1-FA-1-I1-1-I2-1-TR-1-I1-1-I2-1-FA-1-I3-1-I1-1-FA-1-FA-1-NR-1-I3-1-I2-1-TR-1-I1-1-I2-1-I1-1-I2-1-FA-1-I2-1-I1-1-I3-1-FA-1-QU-1-I1-1-I2-1-I2-1-I2-1-NR-1-I2-1-I2-1-NR-1-I1-1-I2-1-I1-1-NR-1-I3-1-QU-1-I2-1-I3-1-QU-1-NR-1-I2-1-I1-1-NR-1-QU-1-QU-1-I2-1-I1-1-EX"
  
  innovation_patterns &lt;- gsub(input, pattern = "-1-", replacement = "-")
  innovation_patterns &lt;- lapply(innovation_patterns, str_extract_all, '(?:I\\d-?)*I3(?:-?I\\d)*')
  </code></pre>
  
  <p>This outputs:</p>
  
  <pre><code>"I2-I3"    "I3-I1"    "I3-I2"    "I2-I1-I3" "I3"       "I2-I3" 
  </code></pre>
  
  <p>However, I only want to extract matches to the regex that are following immediately to a specific string, e.g.: </p>
  
  <p><em>only match the regex when it's preceded by the literal string</em> <code>FA-I2-I2-I2-EX</code>.</p>
  
  <p>This, for example, would be the first match of the regex, while the second match is preceded by <code>FA-I1-I2-TR-I1-I2-FA</code>.</p>
  
  <p>The expected output is roughly the same as in the regex above, but only selecting one of the 5 matches, because it needs to be preceded by a specific literal string.</p>
  
  <p>How can I modify this regex to achieve this purpose? I assume it needs to use a positive lookbehind to first identify the literal string, then execute the regex.</p>