extractwords
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -14,3 +14,3 @@ const defaults = { | ||
if (options.punctuation) { | ||
words = str.match(/\S*[a-zA-Z]+\S*('\S*[a-zA-Z]+\S*)?/g) || []; | ||
words = str.match(/\S+/g) || []; | ||
} else { | ||
@@ -17,0 +17,0 @@ words = str.match(/[a-zA-Z]+('[a-zA-Z]+)?/g) || []; |
{ | ||
"name": "extractwords", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Extract the words from a string", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,18 +20,16 @@ # extractwords [![Build Status](https://api.travis-ci.com/f-a-r-a-z/extractwords.svg?branch=master)](https://travis-ci.com/f-a-r-a-z/extractwords) | ||
extractwords('Good morning, how are you?', {lowercase: true}); | ||
//=> ['good', 'morning', 'how', 'are', 'you'] | ||
extractwords('Good Morning, how are you?', {punctuation: true}); | ||
//=> ['Good', 'Morning,', 'how', 'are', 'you?'] | ||
extractwords('Great work ... son.', {punctuation: true}); | ||
//=> ['Great', 'work', 'son.'] | ||
extractwords("He didn't pay for his meal m'aam"); | ||
//=> ['He', "didn't", 'pay', 'for', 'his', 'meal', "m'aam"] | ||
extractwords("17651Hello*&!(*2I'm_++`~gOOd"); | ||
extractwords("17651Hello*&!(*2I'm_++`~gOOd 2"); | ||
//=> ['Hello', "I'm", 'gOOd'] | ||
extractwords('Good morning, how are you?', {lowercase: true}); | ||
//=> ['good', 'morning', 'how', 'are', 'you'] | ||
extractwords('Good Morning. how are you?', {punctuation: true}); | ||
//=> ['Good', 'Morning.', 'how', 'are', 'you?'] | ||
extractwords('I . am ... go0d 2', {punctuation: true}); | ||
//=> ['I', '.', 'am', '...', 'go0d', '2'] | ||
``` | ||
@@ -66,3 +64,2 @@ | ||
If `true`, all punctuation next to words are retained. | ||
If `true`, all punctuation is retained. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3338
64