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.
x is predefined
For example:
If im looking for a pattern repeating every 9 days
data1 <- 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)
Output: 10.10
If im looking for a pattern repeating every 14 days
data1 <- 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)
Output: 2000
Numbers in between can be anything.