I am trying to write a regex string to match a string revived from an IRC channel.
The message will be in the format "!COMMAND parameters"; the only command that is built by the system so far is repeat.
The regex I am using looks like this:
/![repeat] (.*?)/
When other commands are added it will look like:
/![cmd1|cmd2|cmd3] (.*?)/
It does not seem to be matching the right things in the string. Can anyone offer any input on this?
It appears that I need to add some basic regex stuff.
() brackets return data, [] matches but does not return.
Swapping to () does not work either.
The IRC program I am writing has a dynamic number of commands, so far I have only added "repeat" so the command pattern is "[repeat]". If I added "say", it would be "[repeat|say]".