I created a regex using minimatch library in nodeJs. I wanted to find Date's in the string.
minimatch.makeRe("*/*/*")
It returned
/^(?:(?!\.)(?=.)[^/]*?\/(?!\.)(?=.)[^/]*?\/(?!\.)(?=.)[^/]*?)$/
But when I use the regex in string.search method it is returning 0.
let text = "Some Test Data151.000.0083.680.0046.4020.92 02/03/2000Some Test Data";
console.log(text.search(/^(?:(?!\.)(?=.)[^/]*?\/(?!\.)(?=.)[^/]*?\/(?!\.)(?=.)[^/]*?)$/));
As per the documentation string.search should return the index on which the string is found.
Any suggestions or help will be appreciated.