I'm creating a program that requires the input to contain a certain parameter, that being 3 digits followed by a hyphen, and then two more digits. I cannot find any info on how to do this in my book or on the internet, and i would appreciate it if someone could show me how to, thanks.
// Chapter 13 Example 28.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string str = "";
cout << "Enter a string in the format of 3 digits, a hyphen, and two digits: " << endl;
cin >> str;
while (str != "-1")
return 0;
}