{"id":16392464,"url":"https://github.com/miladsade96/regex_nutshell","last_synced_at":"2026-06-24T10:32:08.819Z","repository":{"id":52380929,"uuid":"520913054","full_name":"miladsade96/regex_nutshell","owner":"miladsade96","description":"Python Regex In a Nutshell","archived":false,"fork":false,"pushed_at":"2022-08-14T11:54:59.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T22:28:52.298Z","etag":null,"topics":["python","python3","regex","regex-match","regex-pattern"],"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/miladsade96.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}},"created_at":"2022-08-03T14:25:34.000Z","updated_at":"2022-08-10T11:51:03.000Z","dependencies_parsed_at":"2022-09-03T20:21:59.157Z","dependency_job_id":null,"html_url":"https://github.com/miladsade96/regex_nutshell","commit_stats":null,"previous_names":["js-mechanic/regex_nutshell","miladsade96/regex_nutshell"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/miladsade96/regex_nutshell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miladsade96%2Fregex_nutshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miladsade96%2Fregex_nutshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miladsade96%2Fregex_nutshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miladsade96%2Fregex_nutshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miladsade96","download_url":"https://codeload.github.com/miladsade96/regex_nutshell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miladsade96%2Fregex_nutshell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34726698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["python","python3","regex","regex-match","regex-pattern"],"created_at":"2024-10-11T04:49:56.937Z","updated_at":"2026-06-24T10:32:08.802Z","avatar_url":"https://github.com/miladsade96.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](logo.png)  \n## Python Regex In a Nutshell\n\n### Author:\nMilad Sadeghi DM - [EverLookneverSee@GitHub](https://elns.info)\n\n### General Examples:\n* Example 1: find 'abc' --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L36-L46)\n* Example 2: find 'abc' - Ignoring case sensitivity --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L48-L56)\n* Example 3: find '.' --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L59-L67)\n* Example 4: find 'elns.info' url --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L70-L78)\n* Example 5: '.' --\u003e Any character except new line --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L81-L89)\n* Example 6: \\d --\u003e Digit (0-9) --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L92-L100)\n* Example 7: \\D --\u003e Non-Digit (0-9) --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L103-L111)\n* Example 8: \\w --\u003e Word character (a-z) (A-Z) (0-9) _ --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L114-L122)\n* Example 9: \\W --\u003e Non-Word character --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L125-L133)\n* Example 10: \\s --\u003e Whitespace character (space, tab, newline) --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L136-L144)\n* Example 11: \\S --\u003e Non-Whitespace character --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/bc9cf8bcd09c002b0795649632cc2e4b5e5d65b8/general.py#L147-L155)\n* Example 12: \\b --\u003e Word boundary --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e346aacce8593da21630351bb0fcd2e1f923b2ee/general.py#L161-L176)\n* Example 13: \\B --\u003e Non-Word boundary --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e346aacce8593da21630351bb0fcd2e1f923b2ee/general.py#L179-L187)\n* Example 14: ^ --\u003e Beginning of a string --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e346aacce8593da21630351bb0fcd2e1f923b2ee/general.py#L190-L198)\n* Example 15: $ --\u003e End of a string --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e346aacce8593da21630351bb0fcd2e1f923b2ee/general.py#L201-L209)\n* Example 16: \\d\\d\\d.\\d\\d\\d.\\d\\d\\d\\d --\u003e Finding phone numbers --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e346aacce8593da21630351bb0fcd2e1f923b2ee/general.py#L212-L220)\n* Example 17: \\d\\d\\d[-.]\\d\\d\\d[-.]\\d\\d\\d\\d --\u003e Finding phone numbers using character set-1 --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e346aacce8593da21630351bb0fcd2e1f923b2ee/general.py#L223-L231)\n* Example 18: [89]00[-.]\\d\\d\\d[-.]\\d\\d\\d\\d --\u003e Finding phone numbers using character set-2 --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e346aacce8593da21630351bb0fcd2e1f923b2ee/general.py#L234-L243)\n* Example 19: [1-5] --\u003e Finding all digits between 1 and 5 --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L251-L259)\n* Example 20: [a-z] --\u003e Finding all lowercase letters --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L262-L270)\n* Example 21: [A-Z] --\u003e Finding all uppercase letters --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L273-L281)\n* Example 22: [a-zA-Z] --\u003e Finding all letters --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L284-L292)\n* Example 23: [^a-zA-Z] --\u003e Finding all non-letters --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L295-L303)\n* Example 24: [^b]at --\u003e Finding cat mat pat except bat --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L306-L314)\n* Example 25: \\d{3}.\\d{3}.\\d{4} --\u003e Finding phone numbers using quantifiers --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L317-L333)\n* Example 26: Mr\\.?\\s[A-Z]\\w* --\u003e Finding all Mr and following names --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/5d9329631d77e1701098640d79d843cfb7ea8d0a/general.py#L336-L344)\n* Example 27 - v1: M(r|s|rs)\\.?\\s[A-Z]\\w* --\u003e Finding all Mr,Ms, Mrs and following names using grouping feature --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/716bed781e4dd3572e99311fd952ba882d4ef6f3/general.py#L351-L359)\n* Example 27 - v2: (Mr|Ms|Mrs)\\.?\\s[A-Z]\\w* --\u003e Finding all Mr,Ms, Mrs and following names using grouping feature --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/716bed781e4dd3572e99311fd952ba882d4ef6f3/general.py#L362-L370)\n* Example 28: [a-zA-Z0-9.-]+@[a-zA-Z-]+\\.(com|net|edu) --\u003e Fining all email addresses that are located in text --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/716bed781e4dd3572e99311fd952ba882d4ef6f3/general.py#L373-L381)\n* Example 29: https?://(www\\.)?(\\w+)(\\.\\w+) --\u003e Finding all web addresses --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L396-L404)\n* Example 30: https?://(www\\.)?(\\w+)(\\.\\w+) --\u003e Finding all web addresses and capturing information using groups--\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L407-L416)\n* Example 31: Reformatting the text using substitution --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L419-L424)\n* Example 32: Using findall to find all urls in text --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L427-L433)\n* Example 33: Using group in findall method --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L436-L442)\n* Example 34: Using match method in order to match the beginning of the string --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L445-L450)\n* Example 35: Using search method in order to search entire of the string --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L453-L458)\n* Example 36: Using ignore case flag --\u003e [view source code](https://github.com/EverLookNeverSee/regex_nutshell/blob/e5bd37a57da3623b9372556dd33a3fc120351f59/general.py#L461-L466)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiladsade96%2Fregex_nutshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiladsade96%2Fregex_nutshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiladsade96%2Fregex_nutshell/lists"}