From 1b65d1d877c96dd6abd403401f30c01c9966f925 Mon Sep 17 00:00:00 2001 From: Aresn Date: Thu, 28 Nov 2024 14:17:00 +0800 Subject: [PATCH] Thu Nov 28 14:17:00 CST 2024 inscode --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 5fd1d72..9e5ba86 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 -- GitLab