I have a string say "dd month yyyy" and I want split to convert to an array, for example ["dd", "," month ",", "yyyy"].
What I still have and this method works. But am I looking for a Reg expression if someone can help?
function toArray(format) { var vDateStr = ''; var vComponantStr = ''; var vCurrChar = ''; var vSeparators = new RegExp('[\/\\ -.,\'":]'); var vDateFormatArray = new Array(); for (var i=0; i < pFormatStr.length; i++ ) { vCurrChar = pFormatStr.charAt(i); if ( (vCurrChar.match(vSeparators) ) || (i + 1 == pFormatStr.length) )
source share