dimanche 17 novembre 2019

How do I write a scanner to get string commands in a text file?

I have a text file 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, 3rd command has to be one of those 4. What's the best way to do this? Should I make an array and then use regexp? Seems complicated...




Aucun commentaire:

Enregistrer un commentaire