{"id":20676474,"url":"https://github.com/sedhossein/pregex","last_synced_at":"2025-04-19T20:56:02.027Z","repository":{"id":62541847,"uuid":"159017197","full_name":"sedhossein/pregex","owner":"sedhossein","description":"A lightweight and powerful PHP package for any Persian regex ","archived":false,"fork":false,"pushed_at":"2020-09-08T18:36:47.000Z","size":87,"stargazers_count":34,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T13:22:17.941Z","etag":null,"topics":["laravel","persian","php","php7","regex","regexes","validation-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/sedhossein.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":"2018-11-25T09:44:06.000Z","updated_at":"2024-11-11T11:20:51.000Z","dependencies_parsed_at":"2022-11-02T16:16:02.998Z","dependency_job_id":null,"html_url":"https://github.com/sedhossein/pregex","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedhossein%2Fpregex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedhossein%2Fpregex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedhossein%2Fpregex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedhossein%2Fpregex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sedhossein","download_url":"https://codeload.github.com/sedhossein/pregex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249799582,"owners_count":21326976,"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":["laravel","persian","php","php7","regex","regexes","validation-library"],"created_at":"2024-11-16T21:12:41.732Z","updated_at":"2025-04-19T20:56:01.997Z","avatar_url":"https://github.com/sedhossein.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pregex: Claim any Persian|Iranian|Farsi|Arabic Regular Expressions that you need\n \n[![Build Status](https://travis-ci.org/sedhossein/pregex.svg?branch=master)](https://travis-ci.org/sedhossein/pregex)\n[![Coverage Status](https://coveralls.io/repos/github/sedhossein/pregex/badge.svg?branch=master)](https://coveralls.io/github/sedhossein/pregex?branch=master)\n[![Version](https://poser.pugx.org/sedhossein/pregex/version)](https://packagist.org/packages/sedhossein/pregex)\n[![Total Downloads](https://poser.pugx.org/sedhossein/pregex/downloads)](https://packagist.org/packages/sedhossein/pregex)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sedhossein/pregex/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/sedhossein/pregex/?branch=master)\n[![License](https://poser.pugx.org/sedhossein/pregex/license)](//packagist.org/packages/sedhossein/pregex)\n\n\n## Quick Access\n- [Introduction](#introduction)\n- [Requirements](#requirements)\n- [How to use](#how-to-use)\n    -  [List of methods](#list-of-methods)\n- [Installation](#how-to-install)\n- [Run Tests](#run-tests)\n- [TODO list](#todo-list)\n- [License](#license)\n\n\n### Introduction\nIf you having a Persian/Iranian project and need to validate your inputs this light library can help you. \nPregex try to make a complete collection of Persian/Iranian validations to make it easy for you. \nPlease kindly feeling free to get in touch with me for any idea you have, or open issue/PR to any bug reporting/fixing.\n\n\n### Requirements\n- composer\n- PHP 7.2 \u003e=\n\n\n### How to use\nPregex prepared the bellow methods list to give you all you need for your validations.\n\n```php\nuse Sedhossein\\Pregex\\Pregex;\n\n$false = (new Pregex)-\u003eIsPersianOrArabicNumber(\"123456\"); // False, cause `123456` are english numbers\n$true = (new Pregex)-\u003eIsPersianOrArabicNumber(\"۱۲۳۴۵۶\");  // True, cause `123456` are persian numbers\n```\nYou can see some more examples in `./examples/index.php`\n\n\n#### list of methods\n```php\nfunction IsPersianNumber(string $number): bool;\n```\n`IsPersianNumber` just validate persian alphabets(not arabic)\n\n---\n```php\nfunction IsArabicNumber(string $number): bool;\n```\n`IsArabicNumber` just validate arabic alphabets(not persian)\n\n---\n```php\nfunction IsPersianOrArabicNumber(string $number): bool;\n```\n`IsPersianOrArabicNumber` validate both Arabic and Persian alphabets. It can be useful when you need just Persian texts\n and user keyboards maybe having different languages(iPhone keyboards, android keyboards or non-standard keyboards)\n\n---\n```php\nfunction IsEmail(string $email): bool;\n```\n`IsEmail` validate emails! Just for getting Pregex more complete for our mission ;))\n\n---\n```php\nfunction IsCellphone(string $number): bool;\n```\n`IsCellphone` validate persian cellphone numbers. Valid inputs can begin with `+98{..}`, `98{..}`, `09{..}`, `9{..}`\n\n---\n```php\nfunction IsIban(string $value): bool;\n```\n`IsIban` or also `Sheba` or `International Bank Account Number (IBAN).` validate Iranian bank Ibans\n\n---\n```php\nfunction IsNationalCode(string $value): bool;\n```\n`IsNationalCode` or also `Melli Code!` validate Iranian national codes\n\n---\n```php\nfunction IsCardNumber(string $value): bool;\n```\n`IsCardNumber` validate Iranian bank card numbers\n\n---\n```php\nfunction IsPostalCode(string $value): bool;\n```\n`IsPostalCode` validate Iranian postal code numbers\n\n---\n```php\nfunction IsPersianText(string $value): bool;\n```\n`IsPersianText` validate Iranian and some Arabic alphabets with some held in common writing signs.\n\n### How to install\nInstall [Composer](https://getcomposer.org) and run following command in your project's root directory:\n```bash\ncomposer require sedhossein/pregex\n```\n\n\n### Run Tests\nAfter installing [Composer](https://getcomposer.org), Clone Pregex Repo and then go to project path(`cd pregex`).\nNow enter:\n```bash\ncomposer install\n```\nNow you fetch all of package dependencies, and you can run bellow command to run tests:\n```bash\n./vendor/phpunit/phpunit/phpunit  --coverage-html ./build/tests/coverage.html\n```\nSo after running above command you can see coverage report on `./build/tests/coverage.html`\n\n\n### TODO list: \n- [ ] Comparing with other libraries to add more features\n\n\n### license\nPregex is initially created by [Sedhossein](https://sedhossein.dev) and released under the [MIT License](http://opensource.org/licenses/mit-license.php).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsedhossein%2Fpregex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsedhossein%2Fpregex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsedhossein%2Fpregex/lists"}