From e28eb0f09f45fc2a477a451e33c1c55fce5abe97 Mon Sep 17 00:00:00 2001 From: Mike Barrett Date: Sat, 15 Dec 2012 22:51:48 +0000 Subject: [PATCH] comment regexps --- timestring.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/timestring.js b/timestring.js index 23c3c2e..fc1dee1 100644 --- a/timestring.js +++ b/timestring.js @@ -71,14 +71,14 @@ unitsRegExp = '(' + unitsRegExp - .replace(/,/g, '|') - .replace('|', '') + .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 - .match(/[-+]?[0-9]*\.?[0-9]+\D/g); + .match(/[-+]?[0-9]*\.?[0-9]+\D/g); // match time groups (digit followed by time unit - i.e 5d 15m = 2 time groups) if (groups !== null) { for(var group in groups) {