title: Using Regex to find repeating transactions
body: <p>I'm relatively new to regex but need to build a query that will search through a timeseries and find recurring transactions, ones that are recurring every x number of days.</p>
  
  <p>x is predefined</p>
  
  <p>For example:</p>
  
  <p>If im looking for a pattern repeating every 9 days</p>
  
  <pre><code>data1 &lt;- c(10.10,0,0,0,0,0,0,0,10.10,0,0,0,0,0,0,0,10.10,0,0,0,0,0,0,0,10.10)
  </code></pre>
  
  <p>Output: <code>10.10</code></p>
  
  <p>If im looking for a pattern repeating every 14 days</p>
  
  <pre><code>data1 &lt;- c(2000,0,0,0,9,0,0,10,0,0,9,0,0,0,0,2000,0,0,0,0,0,0,10.10,0,0,0,10.10,0,0,0,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000)
  </code></pre>
  
  <p>Output: <code>2000</code></p>
  
  <p>Numbers in between can be anything.</p>