I'm quite new to programming in C++ and i'm trying to learn how do we validate if a given word/string in a text file is in the right format. I have text file that contains a line like this:Car,Red,ZX342DC. The line contains the type of vehicle,color,plate. While i'm reading the line I want to perform a check on the string ZX342DC such that it must have 2 upper case letters followed by 3 numbers and 2 upper case letters before assigning this string to a string object. If none of these conditions are met, i want to flag out an error saying there's an invalid entry in line number-" ", ignore the line and move on to the next line in the file.
Aucun commentaire:
Enregistrer un commentaire