Created
January 2, 2017 00:36
-
-
Save anonymous/0b0e94d211521a0678a552489c1bf2c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValid(sample) { | |
var regexp = /(?:\d{2}\.){2}\d{2}(?:\-{1}(?:\d{2}\.){2}\d{2})?;\s?/; | |
console.log(regexp.test(sample)); | |
} | |
Формат нарушен, но true | |
isValid('22.11.16-23.11.18; 231116') | |
isValid('22.11.16------23.11.16;') | |
// true | |
Формат правильный, но false | |
isValid('22.11.16-23.11.16 ;23.11.16') | |
//false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment