Skip to content

Instantly share code, notes, and snippets.

@nilportugues
Created April 19, 2019 10:31
Show Gist options
  • Save nilportugues/fe7592679c86cda104be22ee93568ed1 to your computer and use it in GitHub Desktop.
Save nilportugues/fe7592679c86cda104be22ee93568ed1 to your computer and use it in GitHub Desktop.
detectNonEnglishWord.js
var detectNonEnglishWord = function (text) {
var regex = /^([A-Za-z\-'\. _.,!"\?'])*/g;
return text.replace(regex, "").split(" ");
};
console.log(detectNonEnglishWord("Hello?!! 足下コンクリート"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment