08-11-2009, 02:20 PM
|
#1 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
Date parsing issue
I have this issue where I MUST use JavaScript to parse all dates on the page and reformat them, now I figured using the match method and replace the found results with the reformatted dates would be fine but it stands that my Regex is failing or I'm implementing the method incorrectly.
javascript Code:
var Matches = document.body.innerHTML.match(/\d{4}(\-)\d{2}(\-)\d{2}/); alert(Matches); //Null
Anyone wants to have a looksie and see if possibly I'm just missing the glaringly obvious?
EDIT: Well than...Don't I feel stupid, I was missing the global search 'g' flag...I'll leave this here for anyone's future needs
|
|
|
|