diff --git a/index.js b/index.js index a92a592a..942be381 100644 --- a/index.js +++ b/index.js @@ -46,9 +46,9 @@ function parserForArrayFormat(opts) { switch (opts.arrayFormat) { case 'index': return function (key, value, accumulator) { - result = /\[(\d*)]$/.exec(key); + result = /\[(\d*)\]$/.exec(key); - key = key.replace(/\[\d*]$/, ''); + key = key.replace(/\[\d*\]$/, ''); if (!result) { accumulator[key] = value; @@ -64,9 +64,9 @@ function parserForArrayFormat(opts) { case 'bracket': return function (key, value, accumulator) { - result = /(\[])$/.exec(key); + result = /(\[\])$/.exec(key); - key = key.replace(/\[]$/, ''); + key = key.replace(/\[\]$/, ''); if (!result || accumulator[key] === undefined) { accumulator[key] = value;