allow higher version of regex library
This commit is contained in:
2
setup.py
2
setup.py
@@ -15,7 +15,7 @@ setup(name='talon',
|
||||
zip_safe=True,
|
||||
install_requires=[
|
||||
"lxml==2.3.3",
|
||||
"regex==0.1.20110315", # handling of .* changes from version 0 to 1
|
||||
"regex>=1",
|
||||
"html2text",
|
||||
"nose==1.2.1",
|
||||
"mock",
|
||||
|
||||
@@ -17,7 +17,7 @@ from talon.signature.constants import SIGNATURE_MAX_LINES
|
||||
rc = re.compile
|
||||
|
||||
RE_EMAIL = rc('@')
|
||||
RE_RELAX_PHONE = rc('.*(\(? ?[\d]{2,3} ?\)?.{,3}){2,}')
|
||||
RE_RELAX_PHONE = rc('(\(? ?[\d]{2,3} ?\)?.{,3}?){2,}')
|
||||
RE_URL = rc(r'''https?://|www\.[\S]+\.[\S]''')
|
||||
|
||||
# Taken from:
|
||||
|
||||
@@ -43,7 +43,7 @@ VALID_PHONE_NUMBERS = [e.strip() for e in VALID.splitlines() if e.strip()]
|
||||
|
||||
def test_match_phone_numbers():
|
||||
for phone in VALID_PHONE_NUMBERS:
|
||||
ok_(RE_RELAX_PHONE.match(phone), "{} should be matched".format(phone))
|
||||
ok_(RE_RELAX_PHONE.search(phone), "{} should be matched".format(phone))
|
||||
|
||||
|
||||
def test_match_names():
|
||||
|
||||
Reference in New Issue
Block a user