{"id":33988023,"url":"https://github.com/hotmeteor/regex","last_synced_at":"2025-12-13T05:48:06.893Z","repository":{"id":47233058,"uuid":"394318061","full_name":"hotmeteor/regex","owner":"hotmeteor","description":"A set of ready-made regex helper methods for use in your Laravel application.","archived":false,"fork":false,"pushed_at":"2025-06-19T20:01:22.000Z","size":24,"stargazers_count":245,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-28T10:55:30.438Z","etag":null,"topics":["laravel","library","php","regex"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/hotmeteor.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":"2021-08-09T14:15:29.000Z","updated_at":"2025-08-27T12:28:15.000Z","dependencies_parsed_at":"2022-09-12T23:01:05.605Z","dependency_job_id":null,"html_url":"https://github.com/hotmeteor/regex","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/hotmeteor/regex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotmeteor%2Fregex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotmeteor%2Fregex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotmeteor%2Fregex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotmeteor%2Fregex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hotmeteor","download_url":"https://codeload.github.com/hotmeteor/regex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotmeteor%2Fregex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27701096,"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","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"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":["laravel","library","php","regex"],"created_at":"2025-12-13T05:48:05.568Z","updated_at":"2025-12-13T05:48:06.885Z","avatar_url":"https://github.com/hotmeteor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Regex\n\nA set of ready-made regex helper methods for use in your Laravel application.\n\n[![Latest Stable Version](http://poser.pugx.org/hotmeteor/regex/v)](https://packagist.org/packages/hotmeteor/regex)\n\n## Installation\n\n```shell\ncomposer require hotmeteor/regex\n```\n\n## Usage\n\nRegex comes with a set of common regex patterns that are ready to use. These patterns can be used to either **replace** or **match** against values. Every pattern is both case-insensitive and able to interpret unicode characters, and should support all languages.\n\nAdditionally, beyond the methods below both the underlying `match` and `replace` methods are exposed to pass in custom patterns.\n\n### Match\n\nMatch methods return true or false depending on if the subject value contains anything but the expected pattern. \n\nYou may optional allow whitespace by passing `true` as a second parameter.\n\n#### Methods\n\n```php\nRegex::isAlpha($subject, $allowWhitespace = false)\n``` \nChecks if the value contains anything but letters.\n\n***\n\n```php\nRegex::isAlphanumeric($subject, $allowWhitespace = false)\n``` \nChecks if the value contains anything but letters and numbers.\n\n***\n\n```php\nRegex::isAlphadash($subject, $allowWhitespace = false)\n``` \nChecks if the value contains anything but letters, numbers, and `.-_`.\n\n***\n\n```php\nRegex::isDigits($subject, $allowWhitespace = false)\n``` \nChecks if the value contains anything but integers.\n\n***\n\n```php\nRegex::isNumeric($subject)\n``` \nChecks if the value contains anything but numeric values, including decimals and negative numbers. Does not allow for whitespace.\n\n***\n\n```php\nRegex::isUuid($subject)\n``` \nChecks if the value is a UUID. Does not allow for whitespace.\n\n***\n\n```php\nRegex::isIp($subject) // or\nRegex::isIpv4($subject)\n``` \nChecks if the value is an IPv4 address. Does not allow for whitespace.\n\n***\n\n```php\nRegex::isIpv6($subject)\n``` \nChecks if the value is an IPv6 address. Does not allow for whitespace.\n\n### Replace\n\nReplace methods replace anything in the subject value that doesn't match the pattern with the provided replacement.\n\nThe default replacement is nothing: it just removes the character.\n\n#### Methods\n```php\nRegex::alpha($subject, $replace = '')\n``` \nReplaces all characters in the subject except letters.\n\n***\n\n```php\nRegex::alphanumeric($subject, $replace = '')\n``` \nReplaces all characters in the subject except letters and numbers.\n\n***\n\n```php\nRegex::alphadash($subject, $replace = '')\n``` \nReplaces all characters in the subject except letters, numbers, and `.-_`.\n\n***\n\n```php\nRegex::digits($subject, $replace = '')\n``` \nReplaces all characters in the subject except integers.\n\n***\n\n```php\nRegex::numeric($subject, $replace = '')\n``` \nReplaces all characters in the subject except numeric values, including decimals and negative numbers.\n \n***\n\n```php\nRegex::uuid($subject)\n``` \nReplaces all characters in the subject to form it into a UUID. Does not accept a replacement value.\n\n***\n\n```php\nRegex::ip($subject) // or\nRegex::ipv4($subject)\n``` \nReplaces all characters in the subject to form it into an IPv4 address. Does not accept a replacement value.\n\n```php\nRegex::ipv6($subject)\n``` \nReplaces all characters in the subject to form it into an IPv6 address. Does not accept a replacement value.\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhotmeteor%2Fregex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhotmeteor%2Fregex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhotmeteor%2Fregex/lists"}