How to match the string to the user input and then trigger it?

the user interacts with the server by entering characters

users may enter multiple characters, such as

one
two
three
four
.
50

these strings are defined and have no features. when they match this keyword, they automatically reply to the user with a fixed command

.

for example, when user input helps me find a xxx, it matches "one"

.

when the user enters another bunch of strings that match this keyword, reply to another fixed command

currently uses the match method, but each condition needs to be defined once

is there a more convenient way?

Mar.20,2021

if the program is purely implemented, the match, or indexOf you say is probably the best way, and there are no shortcuts. If you are willing to study ElasticSearch, give you Amway a wave of ElasticSearch search engine matching. The query only needs to insert the ES, query ES

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b352be-2bf79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b352be-2bf79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?