remove redundant regex

This commit is contained in:
Mike Barrett 2012-12-30 23:28:02 +00:00
parent fc1941e2bc
commit 330faf85e0

View File

@ -62,19 +62,6 @@
// seconds counter
var totalSeconds = 0;
// dynamically generate units regular expression
var unitsRegExp = '';
for(var unit in this.units) {
unitsRegExp += ',' + this.units[unit].join();
}
unitsRegExp = '(' +
unitsRegExp
.replace(/,/g, '|') // convert commas to pipes
.replace('|', '') // removing leading pipe
+ ')';
// split string into groups and get total seconds for each group
var groups = string
.replace(/[^\w+-]+/g, '') // remove white space