diff --git a/index.js b/index.js index 5fd1d723c5e14f1d92963318bb8380f3b7d2b306..9e5ba8676320b334190dc08b97981ad3e9a352f4 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ function aa (str) { - const englishRegex = /^[a-zA-Z]+$/; - return englishRegex.test(str); + const regex = /^[a-zA-Z\s.,!?'"*_\[\]()#\-,。!?:《》()【】“”‘’]*$/; + return regex.test(str); } -const a = aa('this is a good idea') +const a = aa('this is a, good idea.') console.log(a); \ No newline at end of file