I need help with my C++ code.
I want to search a file and read it line by line and if the parent of a phone number matches it must print that line to another file.
I am able to match a string but not sure : How to match a format/pattern of a phone number Phone numbers can be different. I just want to follow the format of phone number match.
Example of Number can be xx-xxx-xxxx
This is my code take a look
// reading a text file
if (mywritingfile.is_open())
{
//Getting data line from file.
while ( getline (myfile,line) )
{
if (Match the Pattren from the line)//Need Help Here.
{
//Printing the Mached line Content Of the source File to the destination the File.
//Output Every line that it fetches
cout << line << endl;
mywritingfile << line << endl;
matches++;
}
}
}