title: Split on first/nth occurrence of delimiter
body: <p>I am trying something I thought would be easy.  I'm looking for a single regex solution (though others are welcomed for completeness).  I want to split on n occurrences of a delimiter.  </p>
  
  <p>Here is some data:</p>
  
  <pre><code>x &lt;- "I like_to see_how_too"
  pat &lt;- "_"
  </code></pre>
  
  <p><strong>Desired outcome</strong></p>
  
  <p><em>Say I want to split on first occurrence of <code>_</code>:</em></p>
  
  <pre><code>[1] "I like"  "to see_how_too"
  </code></pre>
  
  <p><em>Say I want to split on second occurrence of <code>_</code>:</em></p>
  
  <pre><code>[1] "I like_to see"   "how_too"
  </code></pre>
  
  <p>Ideally, if the solution is a regex one liner generalizable to nth occurrence; the solution will use <code>strsplit</code> with a single regex.</p>
  
  <p>Here's a solution that doesn't fit my parameters of single regex that works with <code>strsplit</code></p>
  
  <pre><code>x &lt;- "I like_to see_how_too"
  y &lt;- "_"
  n &lt;- 1
  loc &lt;- gregexpr("_", x)[[1]][n]
  
  c(substr(x, 1, loc-1), substr(x, loc + 1, nchar(x)))
  </code></pre>