3 ms·
const pattern = /I hope this (\w+) finds you well\./; if (pattern.test(text)) { console.log("is ai."); } else { console.log("not ai.");
by arpowers 3y ago
const pattern = /I hope this (\w+) finds you well\./;
if (pattern.test(text)) {
console.log("is ai.");
} else {
console.log("not ai.");
}
- richbell 3y agoThis won't work, you'd need at least... 3 more test cases. /I hope this (\w+) finds you well\.|It's important to note that |As a large language model/
- wewtyflakes 3y agoYou may need one of the adjacent spaces in your capture group
- LoganDark 3y agoI hope this dfajklgsdfjklagsdfjklsd finds you well.