Skip to content

Instantly share code, notes, and snippets.

@andevsoftware
Last active March 5, 2016 20:07
Show Gist options
  • Save andevsoftware/b9a5a5a287ea0fc8516a to your computer and use it in GitHub Desktop.
Save andevsoftware/b9a5a5a287ea0fc8516a to your computer and use it in GitHub Desktop.
TSValidate.Validators.Regex
import Regex = TSValidate.Validators.Regex;
validator.add('created_at', new Regex()
.pattern(/^[0-9]{4}[-\/](0[1-9]|1[12])[-\/](0[1-9]|[12][0-9]|3[01])$/)
.message('The creation date is invalid')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment