{"id":22692943,"url":"https://github.com/ldrahnik/regexp","last_synced_at":"2026-05-18T03:02:03.046Z","repository":{"id":25432397,"uuid":"28861987","full_name":"ldrahnik/regexp","owner":"ldrahnik","description":"Keeper of regular expressions.","archived":false,"fork":false,"pushed_at":"2017-09-17T20:32:15.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-08T17:43:21.149Z","etag":null,"topics":["nette","package","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ldrahnik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-06T12:14:39.000Z","updated_at":"2017-09-17T20:12:21.000Z","dependencies_parsed_at":"2022-07-26T07:01:58.450Z","dependency_job_id":null,"html_url":"https://github.com/ldrahnik/regexp","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ldrahnik/regexp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrahnik%2Fregexp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrahnik%2Fregexp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrahnik%2Fregexp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrahnik%2Fregexp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldrahnik","download_url":"https://codeload.github.com/ldrahnik/regexp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrahnik%2Fregexp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33163413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"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":["nette","package","php"],"created_at":"2024-12-10T02:08:31.972Z","updated_at":"2026-05-18T03:02:03.031Z","avatar_url":"https://github.com/ldrahnik.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"ldrahnik/regexp\n======\n\n[![Build Status](https://travis-ci.org/ldrahnik/regexp.svg)](https://travis-ci.org/ldrahnik/regexp)\n[![Latest stable](https://img.shields.io/packagist/v/ldrahnik/regexp.svg)](https://packagist.org/packages/ldrahnik/regext)\n[![Downloads total](https://img.shields.io/packagist/dt/ldrahnik/regexp.svg?style=flat-square)](https://packagist.org/packages/ldrahnik/regexp)\n\nSet of regular expressions.\n\nRequirements\n------------\n\nldrahnik/regexp requires PHP 5.4 or higher.\n\n- [Nette Framework](https://github.com/nette/nette)\n\nInstallation\n------------\n\nInstall regexp to your project using  [Composer](http://getcomposer.org/):\n\n```sh\n$ composer require ldrahnik/regexp\n```\n\nUsage\n-----\n\nRegister extension in config file\n\n```sh\nextensions:\n\tregexp: regexp\\DI\\RegexpHelperExtension\n\nregexp:\n\tmyRegularName: ^[0-9]{1,10}$\n\ttwitterUsername: foo\n```\n\nNow you can use all regulars through services\n\n```php\n\t/** @var \\regexp\\Regexp @inject */\n\tprivate $regexp;\n\n    public function __construct(regexp\\Regexp $regexp)\n    {\n    \t$this-\u003eregexp = $regexp;\n    }\n    \n    public function createComponentForm()\n    {\n        $form = new Nette\\Application\\UI\\Form();\n        $form-\u003eaddText('twitter', 'Twitter username')\n            -\u003esetDefaultValue('@')\n            -\u003eaddCondition(Form::FILLED)\n        \t    -\u003eaddRule(Form::PATTERN, 'Please enter twitter username, for example: @username',\n        \t    $this-\u003eregexp-\u003egetTwitterUsername());\n        ...\n\n        //  $this-\u003eregexp-\u003egetRegularExpression('twitterUsername'));\n        //  equivalent of that expression is\n        //  $this-\u003eregexp-\u003egetTwitterUsername();\n    }\n    \n    ....\n```\n\nYou are able to use or override already existing embedded regular expressions\n\n```sh\n'username' =\u003e '^[a-z0-9_-]{3,16}$',\n'twitterUsername' =\u003e  '^(\\@)?[A-Za-z0-9_]+$',\n'password' =\u003e '^[a-z0-9_-]{6,18}$',\n'facebook' =\u003e '^(https?:\\/\\/)?(www\\.)?facebook.com\\/[a-zA-Z0-9(\\.\\?)?]',\n'google' =\u003e '((http|https):\\/\\/)?(www[.])?plus\\.google\\.com\\/.?\\/?.?\\/?([0-9]*)'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldrahnik%2Fregexp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldrahnik%2Fregexp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldrahnik%2Fregexp/lists"}