I need the user to input a reference with this exact model : ####.###
There must be exactly 8 characters, the fifth being a full stop.

for the moment I put this code i a while statement in check the length of the string and if the fifth character is a full stop.

How can I check that the other characters are numbers ? Keeping in mind that I would need the user to input the reference in a single step.

```
bool wrongRef{true};
std::string ref;
while (wrongRef)
{
    std::cout << "Enter the reference (####.###) : ";
    std::cin >> ref;
    if (ref[4] == '.' && ref.length() == 8 )
    {
        wrongRef = false;
    }
    else
        std::cout << "Wrong input. Reference should be '####.###'\n";
}

```

Thank you for your help.