Regex for messages
trying to have a message read aloud when someone says a keyword like hi, hello, i want it to only check the first word for the keyword
Regex:
/\b(hi|suh|sup|hello|hey|greetings|good morning|good afternoon|good evening)\b/i
this reads the message weither the hi is the first, last or middle word6 Replies
Try
/^(hi|suh|sup|hello|hey|greetings|good morning|good afternoon|good evening)\b/i
RegExr
RegExr: Learn, Build, & Test RegEx
RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp).
regex101
regex101: build, test, and debug regex
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.
Yeah that works too. Just make sure you use the JavaScript flavor
OHHH thats why it didnt work lol i didnt even see that it was set to, PHP instead of javascript lol
Hehe yeah that gets me too