artdaq_node_server  v1_00_09
 All Classes Namespaces Files Variables Pages
words.js
1 var asciiWords = require('./_asciiWords'),
2  hasUnicodeWord = require('./_hasUnicodeWord'),
3  toString = require('./toString'),
4  unicodeWords = require('./_unicodeWords');
5 
25 function words(string, pattern, guard) {
26  string = toString(string);
27  pattern = guard ? undefined : pattern;
28 
29  if (pattern === undefined) {
30  return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
31  }
32  return string.match(pattern) || [];
33 }
34 
35 module.exports = words;