Skip to main content

Find all dates, times, emails, phone numbers, links, emails, ip addresses, prices, bitcoin address, and street addresses in a string.

Project description

Find all times, dates, links, phone numbers, emails, ip addresses, and prices in a string.


>>> from commonregex import CommonRegex
>>> parsed_text = CommonRegex("John, please get that article on to me by 5:00PM
                               on Jan 9th 2012. 4:00 would be ideal, actually. If you have any
                               questions, You can reach me at (519)-236-2723 or get in touch with
                               my associate at")
>>> parsed_text.times
['5:00PM', '4:00']
>>> parsed_text.dates
['Jan 9th 2012']
>>> parsed_text.links
>>> parsed_text.phones
>>> parsed_text.emails

Alternatively, you can generate a single CommonRegex instance and use it to parse multiple segments of text.

>>> parser = CommonRegex()
>>> parser.times("When are you free?  Do you want to meet up for coffee at 4:00?")

Please note that this module is currently English/US specific.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for commonregex, version 1.5.3
Filename, size File type Python version Upload date Hashes
Filename, size commonregex-1.5.4.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page