PHPackages                             modestnerd/localregex - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. modestnerd/localregex

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

modestnerd/localregex
=====================

Regex Patterns

32PHP

Since Aug 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/iamngoni/localregex-php)[ Packagist](https://packagist.org/packages/modestnerd/localregex)[ RSS](/packages/modestnerd-localregex/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

LocalRegex (PHP)
================

[](#localregex-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7c3bececf9ac445dc68c1605da8c7a0d693f90f01b9235f84e0b532284263ef6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f646573746e6572642f6c6f63616c72656765782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/modestnerd/localregex)[![Total Downloads](https://camo.githubusercontent.com/fc3ae80fc9ac19acf0987a7011107104a47a00058189142b0198bae86e6222f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f646573746e6572642f6c6f63616c72656765782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/modestnerd/localregex)[![GitHub Actions](https://github.com/modestnerd/localregex/actions/workflows/main.yml/badge.svg)](https://github.com/modestnerd/localregex/actions/workflows/main.yml/badge.svg)

LocalRegex is a collection of regex patterns particularly tailored for the Zimbabwean environment

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require modestnerd/localregex
```

Usage
-----

[](#usage)

- all methods return a boolean as the result

```
// Email
LocalRegex::isEmail($email);

// Mobile Numbers
LocalRegex::isEconet($number);
LocalRegex::isTelecel($number);
LocalRegex::isNetone($number);

// Check if it's either one of the three i.e. Econet, Telecel or Netone
LocalRegex::isZimMobile($number);

// Check if the mobile number is valid (not tied to Zimbabwe)
LocalRegex::isMobile($number);

// VoIP
LocalRegex::isAfricom($number);
LocalRegex::isDandemutande($number);
LocalRegex::isLiquid($number);
LocalRegex::isPowertel($number);
LocalRegex::isTelco($number);
LocalRegex::isTelone($number);
LocalRegex::isZarnet($number);

// Check if it's either one of the ones listed above
LocalRegex::isZimVoIP($number);

LocalRegex::isNationalId($id);
LocalRegex::isNumberPlate($numberPlate);
LocalRegex::isPassportNumber($passportNumber);
LocalRegex::isDriversLicense($license);

LocalRegex::isUrl('https://modestnerd.co')
LocalRegex::isPassword('P@55WoRD')

// Formatting Numbers
LocalRegex::formatNumber('0771234567', FormatType::CountryCode) // 263771234567
LocalRegex::formatNumber('0771234567', FormatType::CountryCodePlus) // +263771234567
LocalRegex::formatNumber('263771234567', FormatType::Regular) // 0771234567
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ngonidzashe Mangudya](https://github.com/iamngoni)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com) by [Beyond Code](http://beyondco.de/).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/595d37695ae82443fe49534433413413198dd386e28d3d3c95fe59048257f09f?d=identicon)[modestnerd](/maintainers/modestnerd)

---

Top Contributors

[![iamngoni](https://avatars.githubusercontent.com/u/38191932?v=4)](https://github.com/iamngoni "iamngoni (12 commits)")

### Embed Badge

![Health badge](/badges/modestnerd-localregex/health.svg)

```
[![Health](https://phpackages.com/badges/modestnerd-localregex/health.svg)](https://phpackages.com/packages/modestnerd-localregex)
```

###  Alternatives

[maize-tech/laravel-markable

Laravel Markable

755229.4k](/packages/maize-tech-laravel-markable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
