Regex Patterns
An improved version of commonly used regular expressions in Python
Inspired by and improved upon:
This is a collection of commonly used regular expressions. This library provides a simple API interface to match the strings corresponding to specified patterns.
Installation
pip install --upgrade regex-patterns
Usage
from regex_patterns import RegexPatterns
patterns = RegexPatterns()
text = (
"John, please get that article on www.linkedin.com to me by 5:00PM on Jan 9th 2012. "
"4:00 would be ideal, actually or 5:30 P.M. If you have any questions, You can "
"reach me at (519)-236-2723x341 or get in touch with my associate at "
"harold_smith@gmail.com. You can find my ip address at 127.0.0.1 or at "
"64.248.67.225. I also have a secret protected with md5 "
"8a2292371ee60f8212096c06fe3335fd. The internal webpage to get the article from is "
"https://internal.sharepoint.edu.au"
)
date_list = patterns.dates(text)
# ['Jan 9th 2012']
time_list = patterns.times(text)
# ['5:00pm', '4:00 ', '5:30 P.M.']
url_list = patterns.links(text)
# ['www.linkedin.com', 'gmail.com', 'https://internal.sharepoint.edu.au']
phone_list = patterns.phones_with_exts(text)
# ['(519)-236-2723x341']
ip_list = patterns.ips(text)
# ['127.0.0.1', '64.248.67.225']
email_list = patterns.emails(text)
# ['harold_smith@gmail.com']
md5_list = patterns.md5_hashes(text)
# ['8a2292371ee60f8212096c06fe3335fd']
Features / Supported Methods
dates(text: str)times(text: str)phones(text: str)phones_with_exts(text: str)links(text: str)emails(text: str)ipv4s(text: str)ipv6s(text: str)ips(text: str)not_known_ports(text: str)prices(text: str)hex_colors(text: str)credit_cards(text: str)visa_cards(text: str)master_cards(text: str)btc_address(text: str)street_addresses(text: str)zip_codes(text: str)po_boxes(text: str)ssn_numbers(text: str)md5_hashes(text: str)sha1_hashes(text: str)sha256_hashes(text: str)isbn13s(text: str)isbn10s(text: str)mac_addresses(text: str)iban_numbers(text: str)git_repos(text: str)
Metadata
Release files for regex-patterns 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| regex_patterns-1.0.0.tar.gz | 8.7 kB | Without provenance | Details for regex_patterns-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| regex_patterns-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for regex_patterns-1.0.0-py3-none-any.whl |
Total release size: 16.6 kB
Release files / regex_patterns-1.0.0.tar.gz
| Download URL | regex_patterns-1.0.0.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b98ab19f0fab58e12d5f81aaf1b3a275af87c03656660575721407e903dcbc36
|
|
BLAKE2b-256 checksum How to use checksums |
5f452a3a2456ef1b8e0925f7d08be76d0c090320df6f4ce9878477ef3b2e5d32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.9.16 Linux/5.15.0-1031-azure
|
Release files / regex_patterns-1.0.0-py3-none-any.whl
| Download URL | regex_patterns-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f95948c81c0d90af6692b3ad32ee9b70725e6babbf8fb4a0794a51af09f1e87
|
|
BLAKE2b-256 checksum How to use checksums |
efaae6ad19e21ee8b967f46845ae3eb8139f7cf00ca4e0e631be4c99e66d8a32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.9.16 Linux/5.15.0-1031-azure
|
Security for regex-patterns 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.