Split "char *" with two delimiters

Hi, My Arduino receives this from a web form :

char * datetimeVal = "txtYear=2013&txtMonth=10&txtDay=17&txtHour=16&txtMinute=26&txtSecond=00
";

I would like to retrieve values with something like "split" :

char * myYear = datetimeVal.split('=')[1].split('&')[0]

Any idea on how to do it "cleanly" ? and without having to write tons of code lines ? I've tried to deal with "strtok" but this require a "while loop" for the first delimiter and another "while loop" for the second delimiter...

Best regards

Well...this is working, but i am sure it is a very bad code :~

char datetimeVal[] = "txtYear=2013&txtMonth=10&txtDay=17&txtHour=21&txtMinute=22&txtSecond=10";

void setup()
{
  Serial.begin(9600);
}

char* p = strtok(datetimeVal, "&=");
char* myYear;
char* myMonth;
char* myDay;
char* myHour;
char* myMinute;
char* mySecond;
int i = 0;
void loop()
{
  while (p != NULL)
  {
    if(i == 1) {
      myYear = p;
    }
    if(i == 3) {
      myMonth = p;
    }
    if(i == 5) {
      myDay = p;
    }
    if(i == 7) {
      myHour = p;
    }
    if(i == 9) {
      myMinute = p;
    }
    if(i == 11) {
      mySecond = p;
    }
    p = strtok (NULL, "&=");
    i++;
  }
  Serial.print("Year: ");
  Serial.println(myYear);
  Serial.print("Month: ");
  Serial.println(myMonth);
  Serial.print("Day: ");
  Serial.println(myDay);
  Serial.print("Hour: ");
  Serial.println(myHour);
  Serial.print("Minute: ");
  Serial.println(myMinute);
  Serial.print("Second: ");
  Serial.println(mySecond);
  Serial.println("---------------------");
  delay(1000); 
}

The feature that saved my life is that C++ is able to specify two delimiters at once, using :

char* p = strtok(datetimeVal, "&=");

Regards

At the end of the while loop, all the pointers point to the same location. I really don’t think that is what you want.

As far as i am able to achieve my goal with this ugly code, i don't really care where are my pointers at the end of the while loop. They could even be destroyed... so yes, this is what i want. Do not hesitate suggesting better solutions if you have some ;)