Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<regex>
- using namespace std;
- void main() {
- string praviloTelefona = "(\\+)?(\\d{3})(\\()(\\d{2})(\\))(\\d{3})(\\-)?(\\d{3})"; //+387(61)079-678 //+ i - mogu ali nisu obavezni
- string praviloDatuma = "(\\d{1,2})([./]{1})(\\d{1,2})([./]{1})(\\d{4})";//12.1.2016 ili 12/1/2016
- string praviloMail = "([A-Za-z0-9]){5,}(\\.)([A-Za-z0-9]){5,}([@])(gmail|edufit|hotmail|yahoo)(\\.)(ba|com|sr|hr)";//ime.prezime@gmail/hotmail/edufit/.ba/com/sr/hr
- string praviloMail2 = "([A-Za-z]){5,}(\\.)([A-Za-z]){5,}([@])(gmail|edufit|hotmail|yahoo)(\\.)com"; //recimo da mora "com" ici
- string unos;
- do {
- cin >> unos;
- if (regex_match(unos, regex(praviloDatuma)))
- cout << "Dobar " << endl;
- } while (1);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement