I want to find Dates in a document.
And return this Dates in an array.
Lets suppose I have this text:
On the 03/09/2015 I am swiming in a pool, that was build on the 27-03-1994
Now my code should return ['03/09/2015','27-03-1994']
or simply two Date objects in an array.
My idea was to solve this problem with regex, but the method search()
only returns one result and with test()
I only can test a string!
How would you try to solve it? Espacially when you dont know the exact format of the Date? Thanks