title: pivot_wider() on regex occurrence
body: <p>Suppose I have the following data frame:</p>
  <pre><code>my.df &lt;- data.frame(c(&quot;header_1&quot;, &quot;header_2&quot;, &quot;header_3&quot;, 
                        &quot;product_1&quot;, &quot;qty:3&quot;, &quot;date:20151212&quot;, &quot;qty:2&quot;, &quot;date:20151215&quot;,
                        &quot;product_2&quot;, &quot;qty:11&quot;, &quot;date:20151123&quot;,
                        &quot;product_3&quot;, &quot;qty:53&quot;, &quot;date:20151005&quot;, &quot;qty:33&quot;, &quot;date:20161130&quot;, &quot;qty:33&quot;, &quot;date:20160607&quot;))
  names(my.df) &lt;- &quot;col1&quot;
  </code></pre>
  <p>I saw a possible approach in this forum entry &quot;<a href="https://community.rstudio.com/t/is-there-a-way-to-move-every-other-row-in-a-column-into-a-new-column-in-r/61625" rel="nofollow noreferrer">move every other row in a row to a new column</a>&quot; but that would only work if I have continuous data in the column. Since in my case there are repeating sections <code>product_1</code>, <code>product_2</code> and <code>product_3</code>, I was thinking whether there is a possibility to 'restart' <code>pivot_wider()</code> on a regex occurrence, e.g. <code>^product.*</code> or similar ? Alternatively, I could try and subset each repeating section and <code>rbind()</code> them afterwards. Though this seems rather excessive since a file might have dozens of repeating product sections.</p>
  <p>The desired output would look like this:</p>
  <pre><code>+----------+----------+----------+-----------+--------+---------------+
  | header_1 | header_2 | header_3 | product_1 | qty:3  | date:20151212 |
  +----------+----------+----------+-----------+--------+---------------+
  | header_1 | header_2 | header_3 | product_1 | qty:2  | date:20151215 |
  +----------+----------+----------+-----------+--------+---------------+
  | header_1 | header_2 | header_3 | product_2 | qty:11 | date:20151123 |
  +----------+----------+----------+-----------+--------+---------------+
  | header_1 | header_2 | header_3 | product_3 | qty:53 | date:20151005 |
  +----------+----------+----------+-----------+--------+---------------+
  | header_1 | header_2 | header_3 | product_3 | qty:33 | date:20161130 |
  +----------+----------+----------+-----------+--------+---------------+
  | header_1 | header_2 | header_3 | product_3 | qty:33 | date:20160607 |
  +----------+----------+----------+-----------+--------+---------------+
  </code></pre>
  <p>I am obviously not bound to this approach but this is where my current understanding of R and ideas brought.</p>