Program samoistnie przechodzi do obsługi wyjątku, czyli jest gdzieś jakiś błąd, ale nie potrafię go znaleźć
#include <iostream>
#include <regex>
#include <string>
using namespace std;
int main()
{
regex wzor ("\\w{2}-\\d{3}");
int line = 0;
string text;
cout<<"Witaj!"<<endl;
cout<<"Pisz: "<<endl;
while(getline(cin, text))
{
smatch wynik;
++line;
if(regex_search( text, wynik, wzor ))
cout<<" Linia: "<<line<< " : "<<wynik[0]<<endl;
cin>> text;
}
return 0;
}