String format check

I have a vector of strings that are working and I need to check how the string is formed. I am using sscanf in the rest of the function and I need something like this.

if (format("%f,%f,%f")) {
  // Do someting
} else if (format("%d,%d")) {
  // Do something else
} else {
  // Do something
}

      

Can sscanf or something else be used from std?

+3


source to share


1 answer


If you can use tr1, then std::tr1::regex

is the way to go .. take a look here .



+1


source







All Articles