comment regexps
This commit is contained in:
parent
e1bac3ffb9
commit
e28eb0f09f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user