Compare part of string array

Hi again (oh no, it's the noob again!)

I was wondering if it's possible to compare only a part of an array?
For instance, I would like to send the command "blink(5)" to the arduino (via serial) and make the arduino recognize the "blink"-part and thereafter put the number (5 in this case) into a variable.

Does strcmp offer anything useful or do I need some loops?

strcmp is of little use here, but you could use memcmp before trying any loops things

strstr, strtok, or strncmp might do the trick, depending on how you use them

Being a hacker, I would:

check to make sure the length of the string was > 5.
Save inpstr[5], where "inpstr" is whatever your input string is
Set inpstr[5] to 0.
Use strcmp
Restore inpstr[5]

Do watch out for case ("Blink", "blink", "BLINK")

The serial receves only one byte at a time so given that you have a few commands sent to the arduino you can make a state machine.
if first letter is "b"
You have only blink and blast for example that begins with b
then you fetch next char and discard because they are both like.
then you fetch the third char and it can be either "i" or "a".
Now you have what command it is and fetch the number after "("
combining it in a variable until you fetch ")", now you have the full command and variable.

Seems to be awful lot of code, but it is simple to implement

David

Has anybody successfully used boost::spirit on the arduino? Just out of curiosity...