I have either a text file or Textarea input which needs to be scanned for commands which need a required format.
The commands must be in the following order and aren't string sensitive however integers must be of length 1.
1) START 2,4,GO
2) Like
3) ATE, SWAM, SING, DANCE
Note,the 3rd command has to be one of those 4 words. What's the best way to do this? Should I make an array and then use regexp?
An example:
Random text
ignore this
StArt 2,4,Go
Like
aTE
WORKed
NewCommand again
StarT 9,1,Go
Like
Swam
Hence, this file has 2 commands. Based on the commands I will do an action. Output is void. i.e.) a method like regexp might be used and then when a command is read it will call a method which will map the methods like function Ate(e) {console.log("ATE")}