{"id":15029646,"url":"https://github.com/switchcat/range-regex","last_synced_at":"2026-02-25T13:38:50.335Z","repository":{"id":56323501,"uuid":"312722709","full_name":"SwitchCat/range-regex","owner":"SwitchCat","description":"Utility package for generating a regular expression matching numeric ranges","archived":false,"fork":false,"pushed_at":"2020-11-16T15:52:18.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"switchcat","last_synced_at":"2025-01-19T21:49:34.866Z","etag":null,"topics":["php","php74","regex","regex-pattern","regexp","regular-expression","regular-expressions","switchcat-framework"],"latest_commit_sha":null,"homepage":"https://switchcat.agency","language":"HTML","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/SwitchCat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-14T01:33:27.000Z","updated_at":"2020-11-16T15:52:20.000Z","dependencies_parsed_at":"2022-08-15T16:40:29.817Z","dependency_job_id":null,"html_url":"https://github.com/SwitchCat/range-regex","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwitchCat%2Frange-regex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwitchCat%2Frange-regex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwitchCat%2Frange-regex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwitchCat%2Frange-regex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwitchCat","download_url":"https://codeload.github.com/SwitchCat/range-regex/tar.gz/refs/heads/switchcat","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243339384,"owners_count":20275674,"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":["php","php74","regex","regex-pattern","regexp","regular-expression","regular-expressions","switchcat-framework"],"created_at":"2024-09-24T20:11:16.218Z","updated_at":"2025-10-30T10:12:37.447Z","avatar_url":"https://github.com/SwitchCat.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- PROJECT SHIELDS --\u003e\n[![Twitter Follow](https://img.shields.io/twitter/follow/SwitchcatA?style=social)](https://twitter.com/SwitchcatA)\n[![Issues](https://img.shields.io/github/issues/SwitchCat/range-regex.svg?style=flat-square)](https://github.com/SwitchCat/range-regex/issues)\n![GitHub All Releases](https://img.shields.io/github/downloads/SwitchCat/range-regex/total?logo=GitHub)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/73d45acfd5e84452939d50c4d617680f)](https://app.codacy.com/gh/SwitchCat/range-regex?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=SwitchCat/range-regex\u0026utm_campaign=Badge_Grade)\n\u003cimg src=\"https://img.shields.io/static/v1?label=SwitchCat\u0026message=Framework\u0026color=ff7701\u0026style=flat-square\" /\u003e\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eSwitchCat/range-regex\u003c/h1\u003e\n\u003c/p\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n## Table of Contents\n\n* [Getting Started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Installation](#installation)\n* [Usage](#usage)\n* [Contributing](#contributing)\n* [License](#license)\n* [Contact](#contact)\n* [Acknowledgements](#acknowledgements)\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nTo get a local copy up and running follow these simple steps.\n\n\u003c!-- PREREQUISITES --\u003e\n### Prerequisites\n\n* PHP7.4+\n* ext-mbstring\n* [Composer](https://getcomposer.org/)\n\n\u003c!-- INSTALLATION --\u003e\n### Installation\n\nUse composer from the root of your project folder to download the library.\n```sh\ncomposer require switchcat/range-regex\n```\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n\u003cp\u003eAll method return an array containing either the element's data either an array of elements with their data.\u003c/p\u003e\n\n* Create the periodic object\n```sh\nuse SwitchCat\\RangeRegex\\FactoryDefault;\nuse SwitchCat\\RangeRegex\\Range;\n\n$Factory = new FactoryDefault();\n$converter = $Factory-\u003egetConverter();\n$Range = new Range(int $min, int $max);\n\n$regex = sprintf('/^(%s)$/', $converter-\u003etoRegex($Range));\n// /^([1-9]|[1-9][0-9]|[1-9][0-9]{2}|[1-2][0-9]{3}|3[0-3][0-9]{2}|34[0-4][0-9]|345[0-6])$/\n```\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\n\u003ca href=\"https://switchcat.agency\" \u003e\u003cimg src=\"https://img.shields.io/static/v1?label=SwitchCat\u0026message=Agency\u0026color=ff7701\u0026style=for-the-badge\" /\u003e\u003c/a\u003e\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n## Acknowledgements \n\nNo major change has been brought to the original package. Basically ported it to php7.4 (fixed compatibility issues) and added a test suite. Some code optimization has been done in order to comply with code inspection standards. \nThe package was marked \"abandoned\" and i found it very usefull. I simply decided to give it a second life.\n\nBased on the work of:\n\n- \u003ca href=\"https://github.com/hansott/range-regex\" \u003ehansott/range-regex\u003c/a\u003e \n- \u003ca href=\"https://github.com/micromatch/to-regex-range\" \u003emicromatch/to-regex-range\u003c/a\u003e\n- \u003ca href=\"https://github.com/jonschlinkert/to-regex-range\" \u003ejonschlinkert/to-regex-range\u003c/a\u003e\n\n## Credits\n\n- \u003ca href=\"https://github.com/hansott\" \u003eHans Ott\u003c/a\u003e\n- \u003ca href=\"https://github.com/switchcat\" \u003eFelix Eloy\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchcat%2Frange-regex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswitchcat%2Frange-regex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchcat%2Frange-regex/lists"}