This repository has been archived by the owner on Dec 24, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 52
Home
Lk Geimfari edited this page Dec 6, 2016
·
5 revisions
expynent is a tiny library that provides RegEx patterns. This can be useful if you don't want to write regular expression manually.
➜ ~ git clone https://github.com/lk-geimfari/expynent.git
➜ ~ cd expynent/
➜ ~ python setup.py install
or
➜ ~ pip install expynent
Just import the pattern that you want:
import re
import expynent.patterns as expas
if re.match(expas.ZIP_CODE['RU'], '43134'):
print('match')
else:
print('not match')
# Output: 'not match'
also you can use compiled patterns:
from expynent.compiled import username
u = input('Enter username: ')
if username.match(u):
print('valid')
else:
print('invalid')
This is an experimental project and it's mean that we do not guarantee stability.