lk-geimfari / Expynent
Licence: bsd-3-clause
A library that provides regular expression patterns. If you hate to write regular expressions, then expynent can help you.
Stars: ✭ 350
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Expynent
librxvm
non-backtracking NFA-based regular expression library, for C and Python
Stars: ✭ 57 (-83.71%)
Mutual labels: patterns, regex
lua-patterns
Lua Patterns Viewer. A tool for inspecting, analyzing and learning Lua patterns.
Stars: ✭ 71 (-79.71%)
Mutual labels: patterns, regex
Entwine
Testing tools and utilities for Apple's Combine framework.
Stars: ✭ 306 (-12.57%)
Mutual labels: test
Bluepic
WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Stars: ✭ 322 (-8%)
Mutual labels: patterns
Fd
A simple, fast and user-friendly alternative to 'find'
Stars: ✭ 19,851 (+5571.71%)
Mutual labels: regex
Pattern.css
CSS only library to fill empty background with beautiful patterns.
Stars: ✭ 3,481 (+894.57%)
Mutual labels: patterns
Imageflow
High-performance image manipulation for web servers. Includes imageflow_server, imageflow_tool, and libimageflow
Stars: ✭ 3,643 (+940.86%)
Mutual labels: lib
Ictextview
UITextView subclass supporting string/regex search and highlighting
Stars: ✭ 321 (-8.29%)
Mutual labels: regex
Generex
A Java library for generating String from a regular expression.
Stars: ✭ 316 (-9.71%)
Mutual labels: regex
Cursive re
Readable regular expressions for Python 3.6 and up.
Stars: ✭ 311 (-11.14%)
Mutual labels: regex
Scala typeclassopedia
Abstractions and constructions from math (Category theory, Abstract algebra) implementations in Scala, minimal description, links to good explanations, links to implementations in other FP languages: Haskell, Idris, Purescript, non FP too: Java, C++ and to formalizations in proof assistants: Coq (UniMath, HoTT book), Cubical Agda.
Stars: ✭ 338 (-3.43%)
Mutual labels: patterns
Social Media Profiles Regexs
📇 Extract social media profiles and more with regular expressions
Stars: ✭ 324 (-7.43%)
Mutual labels: regex
Css Doodle
🎨 A web component for drawing patterns with CSS.
Stars: ✭ 4,014 (+1046.86%)
Mutual labels: patterns
Expynent - Common Regular Expression
Expynent is a tiny library that provides common regular expression patterns. This can be useful if you don't want to write regular expression manually. Also you can use this library as fixture for testing framework like a py.test.
Installation
~ pip install expynent
Usage
Just import the pattern that you want:
import re
from expynent.patterns import ZIP_CODE
if re.match(ZIP_CODE['RU'], '43134'):
print('match')
else:
print('not match')
# Output: 'not match'
also you can use compiled patterns:
from expynent.compiled import URL
url = 'http://foo.com/blah_blah_(wikipedia)_(again)'
if URL.match(url):
print('valid')
else:
print('invalid')
# Output: 'valid'
Supported patterns
You can look at the list of supported patterns below:
BITCOIN_ADDRESS
CREDIT_CARD
CREDIT_CARD_STRICT
EMAIL_ADDRESS
ETHEREUM_ADDRESS
FLOAT_NUMBER
HEX_VALUE
IP_V4
IP_V6
IRC
ISBN
ISO_8601_DATETIME
LATITUDE
LICENSE_PLATE
LONGITUDE
MAC_ADDRESS
PGP_FINGERPRINT
PHONE_NUMBER
ROMAN_NUMERALS
SLUG
TIME_24H_FORMAT
URL
UUID
YANDEX_MONEY
ZIP_CODE
ETHEREUM_HASH
Contributing
Your contributions are always welcome! Please take a look at the contribution guidelines first.
Attention
This is an experimental project and it's mean that we do not guarantee stability. We try to write tests for all expressions, but we cannot guarantee the perfect operation of regular expressions because it is impossible to cover all cases.
Licence
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].