PHPackages                             mawebdk/preg-match - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mawebdk/preg-match

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mawebdk/preg-match
==================

PregMatch is an encapsulation of preg\_match returning a boolean instead of 0/1 and throwing an exception in case of an error.

1.0.0(1y ago)0791BSD-2-ClausePHPPHP ^8.3.6

Since Feb 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mawebdk/preg-match)[ Packagist](https://packagist.org/packages/mawebdk/preg-match)[ RSS](/packages/mawebdk-preg-match/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

preg-match
==========

[](#preg-match)

PregMatch is an encapsulation of preg\_match returning a boolean instead of 0/1 and throwing an instance of PregMatchException in case of an error.

The parameters for PregMatch::pregMatch() behaves the same as the parameters for PHP's built-in function preg\_match() except for the absence of the parameters "flags" and "offset".

Usage
-----

[](#usage)

```
try {
    if (PregMatch::pregMatch($pattern, $subject, $matches)):
        // Code in case on a matched regular expression.
    else:
        // Code in case on a non-matched regular expression.
    endif;
} catch (PregMatchException $e) {
    // Error handling.
}

```

###  Health Score

31

—

LowBetter than 65% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

541d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/176606063?v=4)[mawebdk](/maintainers/mawebdk)[@mawebdk](https://github.com/mawebdk)

---

Top Contributors

[![mawebdk](https://avatars.githubusercontent.com/u/176606063?v=4)](https://github.com/mawebdk "mawebdk (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mawebdk-preg-match/health.svg)

```
[![Health](https://phpackages.com/badges/mawebdk-preg-match/health.svg)](https://phpackages.com/packages/mawebdk-preg-match)
```

###  Alternatives

[toplan/laravel-sms

A mobile phone number validation solution based on laravel

83580.2k2](/packages/toplan-laravel-sms)[drupal/coder

Coder is a library to review Drupal code.

3046.8M629](/packages/drupal-coder)[ph-7/eu-vat-validator

A simple and clean PHP class that validates EU VAT numbers against the central ec.europa.eu database (using the official europa API).

97510.7k1](/packages/ph-7-eu-vat-validator)[hyperf/validation

hyperf validation

122.2M213](/packages/hyperf-validation)[udokmeci/yii2-phone-validator

Modern Yii2 Phone validator wrapper on top of PhoneNumberUtil library also used by Android devices

36227.5k1](/packages/udokmeci-yii2-phone-validator)[snowcap/vat-validation

EU VAT number validation

10112.3k](/packages/snowcap-vat-validation)

PHPackages © 2026

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