From: Tim Wood Date: Wed, 11 Apr 2012 03:09:10 +0000 (-0700) Subject: Shortening parse token regexes X-Git-Tag: 1.6.0~1^2~11^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8b2306f404b916deeeffdf8aa80346e6b593b0c;p=thirdparty%2Fmoment.git Shortening parse token regexes --- diff --git a/moment.js b/moment.js index 69fa28157..2d72ce1c8 100644 --- a/moment.js +++ b/moment.js @@ -33,11 +33,12 @@ inputCharacters = /(\\)?([0-9]{1,2}[\u6708\uC6D4]|[0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi, // parsing token regexes - parseTokenFourDigits = /[0-9]{4}/, // 0000 - 9999 - parseTokenTwoDigits = /[0-9]{2}/, // 00 - 99 - parseTokenOneOrTwoDigits = /[0-9]{1,2}/, // 0 - 99 - parseTokenThreeDigits = /[0-9]{3}/, // 000 - 999 - parseTokenOneToThreeDigits = /[0-9]{1,3}/, // 0 - 999 + parseTokenOneDigit = /\d/, // 0 - 9 + parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 + parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 + parseTokenTwoDigits = /\d\d/, // 00 - 99 + parseTokenThreeDigits = /\d{3}/, // 000 - 999 + parseTokenFourDigits = /\d{4}/, // 0000 - 9999 parseTokenWord = /[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i, // any word characters or numbers parseTokenTimezone = /[\+\-]\d\d:?\d\d/i, // +00:00 -00:00 +0000 -0000 parseTokenT = /T/i, // T (ISO seperator)