{"id":13446468,"url":"https://github.com/madisonmay/CommonRegex","last_synced_at":"2025-03-21T06:31:22.040Z","repository":{"id":12578670,"uuid":"15249309","full_name":"madisonmay/CommonRegex","owner":"madisonmay","description":"A collection of common regular expressions bundled with an easy to use interface.","archived":false,"fork":false,"pushed_at":"2023-04-20T18:31:08.000Z","size":114,"stargazers_count":1570,"open_issues_count":22,"forks_count":141,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-03-14T22:12:03.836Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madisonmay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-12-17T08:43:14.000Z","updated_at":"2025-03-14T06:59:27.000Z","dependencies_parsed_at":"2024-01-13T10:41:32.801Z","dependency_job_id":null,"html_url":"https://github.com/madisonmay/CommonRegex","commit_stats":{"total_commits":84,"total_committers":14,"mean_commits":6.0,"dds":"0.23809523809523814","last_synced_commit":"2425abdb79c8992b8b655c27e1fb195cc54457ab"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madisonmay%2FCommonRegex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madisonmay%2FCommonRegex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madisonmay%2FCommonRegex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madisonmay%2FCommonRegex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madisonmay","download_url":"https://codeload.github.com/madisonmay/CommonRegex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244750760,"owners_count":20504137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:00:53.576Z","updated_at":"2025-03-21T06:31:21.667Z","avatar_url":"https://github.com/madisonmay.png","language":"Python","funding_links":[],"categories":["Python","Libraries"],"sub_categories":[],"readme":"CommonRegex\n===========\n\nFind all times, dates, links, phone numbers, emails, ip addresses, prices, hex colors, and credit card numbers in a string. \nWe did the hard work so you don't have to.\n\nPull requests welcome!\n\nInstallation\n-------\nInstall via pip\n\n    sudo pip install commonregex\n    \nor via setup.py\n\n    python setup.py install\n\n\nUsage\n------\n\n```python    \n\u003e\u003e\u003e from commonregex import CommonRegex\n\u003e\u003e\u003e parsed_text = CommonRegex(\"\"\"John, please get that article on www.linkedin.com to me by 5:00PM \n                               on Jan 9th 2012. 4:00 would be ideal, actually. If you have any \n                               questions, You can reach me at (519)-236-2723x341 or get in touch with\n                               my associate at harold.smith@gmail.com\"\"\")\n\u003e\u003e\u003e parsed_text.times\n['5:00PM', '4:00']\n\u003e\u003e\u003e parsed_text.dates\n['Jan 9th 2012']\n\u003e\u003e\u003e parsed_text.links\n['www.linkedin.com']\n\u003e\u003e\u003e parsed_text.phones\n['(519)-236-2727']\n\u003e\u003e\u003e parsed_text.phones_with_exts\n['(519)-236-2723x341']\n\u003e\u003e\u003e parsed_text.emails\n['harold.smith@gmail.com']\n```\n    \nAlternatively, you can generate a single CommonRegex instance and use it to parse multiple segments of text.\n\n```python\n\u003e\u003e\u003e parser = CommonRegex()\n\u003e\u003e\u003e parser.times(\"When are you free?  Do you want to meet up for coffee at 4:00?\")\n['4:00']\n```\n    \nFinally, all regular expressions used are publicly exposed. \n\n```python\n\u003e\u003e\u003e from commonregex import email\n\u003e\u003e\u003e import re\n\u003e\u003e\u003e text = \"...get in touch with my associate at harold.smith@gmail.com\"\n\u003e\u003e\u003e re.sub(email, \"anon@example.com\", text)\n'...get in touch with my associate at anon@example.com'\n```\n\n```python\n\u003e\u003e\u003e from commonregex import time\n\u003e\u003e\u003e for m in time.finditer(\"Does 6:00 or 7:00 work better?\"):\n\u003e\u003e\u003e     print m.start(), m.group()     \n5 6:00 \n13 7:00 \n```\n\n    \nPlease note that this module is currently English/US specific.\n\nSupported Methods/Attributes\n-----------------------------\n\n  - `obj.dates`, `obj.dates()`\n  - `obj.times`, `obj.times()`\n  - `obj.phones`, `obj.phones()`\n  - `obj.phones_with_exts`, `obj.phones_with_exts()`\n  - `obj.links`, `obj.links()`\n  - `obj.emails`, `obj.emails()`\n  - `obj.ips`, `obj.ips()`\n  - `obj.ipv6s`, `obj.ipv6s()`\n  - `obj.prices`, `obj.prices()`\n  - `obj.hex_colors`, `obj.hex_colors()`\n  - `obj.credit_cards`, `obj.credit_cards()`\n  - `obj.btc_addresses`, `obj.btc_addresses()`\n  - `obj.street_addresses`, `obj.street_addresses()`\n  - `obj.zip_codes`, `obj.zip_codes()`\n  - `obj.po_boxes`, `obj.po_boxes()`\n  - `obj.ssn_number`, `obj.ssn_number()`\n\nCommonRegex Ports:\n----------------------------------------\n[CommonRegexRust](https://github.com/hskang9/CommonRegexRust)\n\n[CommonRegexJS] (https://github.com/talyssonoc/CommonRegexJS)\n\n[CommonRegexScala] (https://github.com/everpeace/CommonRegexScala)    \n\n[CommonRegexJava] (https://github.com/talyssonoc/CommonRegexJava)\n\n[CommonRegexCobra] (https://github.com/PurityLake/CommonRegex-Cobra)\n\n[CommonRegexDart] (https://github.com/aufdemrand/CommonRegexDart)\n\n[CommonRegexRuby] (https://github.com/talyssonoc/CommonRegexRuby)\n\n[CommonRegexPHP] (https://github.com/james2doyle/CommonRegexPHP)\n\n[![Analytics](https://ga-beacon.appspot.com/UA-46923950-1/CommonRegex/readme?pixel)](https://github.com/igrigorik/ga-beacon)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadisonmay%2FCommonRegex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadisonmay%2FCommonRegex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadisonmay%2FCommonRegex/lists"}