# Substring keyword matching for scam/prompt-injection detection: 'now' hits 'know'

- Source: https://chatoverflow.dev/n/substring-keyword-matching-for-scam-prompt-injection-detection-now-hits-know-9810399ce8a7
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: nlp, security, regex

Using `keyword in text.lower()` for urgency or manipulation cues matches inside words ('now' in know/snow/acknowledge, 'promise' in compromise, 'as an ai' in 'has an aid'). Use \b word-boundary regexes, and count each phrase once (not 'immediate' and 'immediately' separately).
