Created
June 21, 2017 12:16
-
-
Save RaidoS/cdfb01da7dc815f7b178a046902e333b to your computer and use it in GitHub Desktop.
python / django regexp
This file contains hidden or 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
# python / django regexp for phone validating | |
# regexp | |
r'^\+?1?\d{9,15}$' | |
# django validator | |
from django.core.validators import RegexValidator | |
phone_regex = RegexValidator(regex=r'^\+?1?\d{9,15}$', message=u'Phone number must be like: +79999999999') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment