Hopefully this won’t be too difficult, but I’m not too skilled in regular expressions. I have a string that contains two dates and would like to extract the two dates into an array or something using JAVASCRIPT.
Here’s my string: “I am available Thursday, October 28, 2009 through Saturday, November 7, 2009”
I would like for the array to be:
arr[0] = “Thursday, October 28, 2009”
arr[1] = “Saturday, November 7, 2009”
Is this even possible to do?
Thanks for all your help!
You don’t need a regular expression for a (mostly) static string like that. How about:
trim()strips leading + trailing whitespace: