jpmckinney / validictory

🎓 deprecated general purpose python data validator
Other
240 stars 57 forks source link

Allow patterns compiled with re replacements, like regex #79

Closed jpmckinney closed 9 years ago

jpmckinney commented 9 years ago

Python doesn't support \p{Lu}, etc. which is bananas.

Thankfully, regex does support them.

However, re.match(pattern, value) will blow up if pattern is a compiled regex pattern.

This PR stops the blow-up.

jamesturk commented 9 years ago

just for my own curiosity- what is \p{Lu} ? (hard to search for)

jpmckinney commented 9 years ago

\p{Lu} is all Unicode uppercase letters. Here's several similar classes: http://www.regular-expressions.info/unicode.html

dmr commented 9 years ago

Can you provide a test for this or documentation? I ran into this without knowing that \p{Lu} exists, thanks for sharing!

jpmckinney commented 9 years ago

See #81

dmr commented 9 years ago

Thanks!