I'm trying to split a string at every occurrence of a specific pattern. I have a string like this one:
91.240.109.42FrancePrestashop PI block
2021-06-02213.186.52.66FrancePrestaShop
2012-06-29
And I want to split the string at every occurrence of the date format yyyy-mm-dd
mantaining the date in the splitted array, so the result I want to obtain is this one:
[91.240.109.42FrancePrestashop PI block 2021-06-02,213.186.52.66FrancePrestaShop 2012-06-29]
I have tried to split based on the date format but it does not work:
var splitted_string= result.split(/^\d{4}-\d{2}-\d{2}$/)