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)0231BSD-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 today

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

30

—

LowBetter than 62% of packages

Maintenance41

Moderate activity, may be stable

Popularity8

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

496d 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

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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