PHPackages                             phprivoxy/matcher - 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. phprivoxy/matcher

ActiveLibrary

phprivoxy/matcher
=================

Simple URI matcher without regular expressions.

v0.7.0(1y ago)07MITPHPPHP &gt;=8.1

Since Jun 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/phprivoxy/matcher)[ Packagist](https://packagist.org/packages/phprivoxy/matcher)[ Docs](https://www.phprivoxy.ru)[ RSS](/packages/phprivoxy-matcher/feed)WikiDiscussions main Synced 1mo ago

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

phprivoxy/matcher
=================

[](#phprivoxymatcher)

Simple URI matcher.
-------------------

[](#simple-uri-matcher)

### Requirements

[](#requirements)

- **PHP &gt;= 8.1**

### Installation

[](#installation)

#### Using composer (recommended)

[](#using-composer-recommended)

```
composer create phprivoxy/matcher
```

### Does pattern match the URI

[](#does-pattern-match-the-uri)

```
$uri = 'www.site.ru/cat/page.html';
$matcher = new PHPrivoxy\Matcher\UriMatcher($uri);

$matcher->match('*');               // TRUE
$matcher->match('.');               // TRUE
$matcher->match(''); // FALSE
$matcher->match('site.ru'); // FALSE
$matcher->match('.site.ru');        // TRUE
$matcher->match('*.site.ru');       // TRUE
$matcher->match('*site*');          // TRUE
$matcher->match('.ite.ru'); // FALSE
$matcher->match('*ite.ru');         // TRUE
$matcher->match('/page.html'); // FALSE
$matcher->match('/*page.html');     // TRUE
$matcher->match('/ca');             // TRUE
$matcher->match('/ca*');            // TRUE
$matcher->match('/ca$'); // FALSE
$matcher->match('/cat/page.html$'); // TRUE
$matcher->match('/cat/page.html');  // TRUE
$matcher->match('/cat/page.htm');   // TRUE
$matcher->match('/cat/page.htm');   // TRUE
$matcher->match('*ite.ru/cat/pag'); // TRUE
$matcher->match('*/cat/page.*');    // TRUE
```

Any samples you also may find at "tests" directory.

### Does URI match the patterns

[](#does-uri-match-the-patterns)

```
$patterns = [
    '.яндекс.рф/search',
    'microsoft.com/office',
    '*.microsoft.com/windows',
    '.windows.com',
    'github.com',
    '*linux*'
];

$matcher = new PHPrivoxy\Matcher\PatternsMatcher($patterns);
$matcher->match('https://www.яндекс.рф/'); // FALSE
$matcher->match('https://www.яндекс.рф/search.html');    // TRUE
$matcher->match('https://www.linuxmint.com/');           // TRUE
$matcher->match('https://www.microsoft.com/other/linux-vs-windows/'); // FALSE
$matcher->match('https://www.github.com/windows'); // FALSE
$matcher->match('https://github.com/os2');               // TRUE
$matcher->match('https://linux.github.com/');            // TRUE
$matcher->match('https://www.microsoft.com/office'); // FALSE
$matcher->match('https://microsoft.com/office2024');     // TRUE
$matcher->match('http://left.site/not-exist.html'); // FALSE
```

### License

[](#license)

MIT License See [LICENSE](LICENSE)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

689d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fee2909933723a209942bb8c1c36a3fe570093c46073d276f92215d0f691ffdf?d=identicon)[phprivoxy](/maintainers/phprivoxy)

---

Top Contributors

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

---

Tags

urluripatternMatchmatcherpatternswildcard

### Embed Badge

![Health badge](/badges/phprivoxy-matcher/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)[rawr/t-regx

PHP regular expression brought up to modern standards.

451157.3k3](/packages/rawr-t-regx)[crwlr/url

Swiss Army knife for URLs.

11073.3k3](/packages/crwlr-url)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)

PHPackages © 2026

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