{"id":21490385,"url":"https://github.com/urigoren/nre","last_synced_at":"2025-07-15T17:31:53.087Z","repository":{"id":57447058,"uuid":"208474503","full_name":"urigoren/nre","owner":"urigoren","description":"Nice Regular Expressions","archived":false,"fork":false,"pushed_at":"2020-08-11T14:56:11.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T14:08:38.273Z","etag":null,"topics":["regular-expression"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urigoren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-14T17:07:56.000Z","updated_at":"2021-04-05T09:44:26.000Z","dependencies_parsed_at":"2022-09-16T14:00:53.183Z","dependency_job_id":null,"html_url":"https://github.com/urigoren/nre","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urigoren%2Fnre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urigoren%2Fnre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urigoren%2Fnre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urigoren%2Fnre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urigoren","download_url":"https://codeload.github.com/urigoren/nre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226057051,"owners_count":17566944,"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":["regular-expression"],"created_at":"2024-11-23T14:35:36.745Z","updated_at":"2024-11-23T14:35:37.366Z","avatar_url":"https://github.com/urigoren.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nice Regular Expressions\r\nA simple wrapper around the `re` module that supports multiple patterns, and reuse of patterns.\r\n\r\n## Installation\r\n\r\n    pip install nre\r\n   \r\n## Usage\r\n\r\n    import nre\r\n    patterns = nre.from_string(r'''\r\n    number=\\d+\r\n    decimal={{number}}\\.{{number}}\r\n    lowercase=[a-z]+\r\n    ''')\r\n    print(patterns.decimal.findall(\"123.22\")) # returns ['123.22']\r\n    print(patterns.number.findall(\"123.22\")) # returns ['123', '22']\r\n    print(patterns.decimal.findall(\"abc\"))  # returns []\r\n    print(patterns.lowercase.findall(\"abc\"))  # returns ['abc']\r\n    \r\n We recommend using external pattern files\r\n \r\n     import nre\r\n     patterns = nre.from_file(\"patterns.nre\")\r\n \r\n If you use external files, you can import them within other files\r\n \r\n    # contents of users.nre\r\n    valid_username=[a-zA-z_]+\r\n    \r\n    # contents of emails.nre\r\n    import users\r\n    valid_email={{valid_username}}@gmail.com\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furigoren%2Fnre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furigoren%2Fnre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furigoren%2Fnre/lists"}