Advertisement
Guest User

ređeks

a guest
Jan 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<regex>
  4.  
  5. using namespace std;
  6.  
  7. void main() {
  8.  
  9. string praviloTelefona = "(\\+)?(\\d{3})(\\()(\\d{2})(\\))(\\d{3})(\\-)?(\\d{3})"; //+387(61)079-678 //+ i - mogu ali nisu obavezni
  10. string praviloDatuma = "(\\d{1,2})([./]{1})(\\d{1,2})([./]{1})(\\d{4})";//12.1.2016 ili 12/1/2016
  11.  
  12. 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
  13. string praviloMail2 = "([A-Za-z]){5,}(\\.)([A-Za-z]){5,}([@])(gmail|edufit|hotmail|yahoo)(\\.)com"; //recimo da mora "com" ici
  14.  
  15. string unos;
  16. do {
  17. cin >> unos;
  18. if (regex_match(unos, regex(praviloDatuma)))
  19. cout << "Dobar " << endl;
  20. } while (1);
  21.  
  22.  
  23. system("pause");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement