SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By brian25
#164309
i'm using gsm lib and i want to separate the content of smsbuffer. ex Hello World then i will disregard the Hello and i will only get the World and store in Another byte/char array. tnx
By brian25
#164371
i used arduino lib

Regexp.h
Code: Select all
MatchState ms;
  char * str = smsbuffer;
  ms.Target (str);
  
  unsigned int index = 0;
  char buf [100];
  
  while (true)
  {
  char result = ms.Match ("(%a+)" "(%-?%d+)", index);
  
   if (result == REGEXP_MATCHED){
     for (int j = 0; j < ms.level; j++);
     gsm.WritePhoneNumber(result[j],(%-?%d+);
     index = ms.MatchStart + ms.MatchLength;
   }
   else 
     break;
  }
}

can you help how to correct this one.. tnx
By mlu
#164424
There is a semicolon to much in the for statement:
Code: Select all
     for (int j = 0; j < ms.level; j++);
should be
Code: Select all
     for (int j = 0; j < ms.level; j++)
I think the compiler is complaining about this because with the extra semi colon, j
will not be defined on the next line.
Also the gsm.WritePhoneNumber looks wrong, what is the second argument ?