diff --git a/README.md b/README.md index 48a0933..19da1af 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ slugify('some string', '_') // some_string slugify('some string', { replacement: '-', // replace spaces with replacement remove: null, // regex to remove characters + remover: '', // replace remove regex match with remover lower: true // result in lower case }) ``` diff --git a/index.js b/index.js index 42e921c..05974da 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ .reduce(function (result, ch) { return result + (charMap[ch] || ch) // allowed - .replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]/g, '') + .replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]/g, options.remover || '') }, '') // trim leading/trailing spaces .trim()