tIs it possible for me to detect if a string is ‘all numeric’ or not using tr1 regex?
If yes, please help me with a snipped as well since I am new to regex.
Why I am looking towards tr1 regex for something like this, because I don’t want to create a separate function for detecting if the string is numeric. I want to do it inline in rest of the client code but do not want it to look ugly as well. I feel maybe tr1 regex might help. Not sure, any advises on this?
If you just want to test whether the string has all numeric characters, you can use
std::find_if_notandstd::isdigit:If you do not have a Standard Library implementation with
std::find_if_not, you can easily write it: