From a3c751d3f1fe4030d514be4db90d577499d0bd85 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Thu, 7 Mar 2024 21:58:59 +0000 Subject: global regexp --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index e363916..0e88902 100644 --- a/src/app.js +++ b/src/app.js @@ -37,7 +37,7 @@ app.post('/sms', (req, res) => { sendTextMessage([senderSubscription], confirmationMessage); } else { if (body.toLocaleLowerCase().startsWith('my name is ') || body.toLocaleLowerCase().startsWith('my name is: ')) { - const senderName = body.matchAll(/^my name is:? (.*)$/)?.next()?.[1]; + const senderName = body.matchAll(/^my name is:? (.*)$/g)?.next()?.[1]; if (!senderName) { const twiml = new MessagingResponse(); -- cgit v1.2.3