PHPackages                             vladbabii/leophpard - 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. vladbabii/leophpard

ActiveLibrary

vladbabii/leophpard
===================

Quick url router filter for routes with regular expressions that don't span multiple url pieces

06PHP

Since Jan 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vladbabii/leophpard)[ Packagist](https://packagist.org/packages/vladbabii/leophpard)[ RSS](/packages/vladbabii-leophpard/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

leoPHPard
=========

[](#leophpard)

Quick url router filter for routes with regular expressions that don't span multiple url pieces.

It takes an partial of this format: a/b/c/d

And an array of routes with or without regular expressions:

a/c/d/f

some/account/{\[0-9\]{2,10}/

a/{\[a-z\]}/c/d

In this case the list will become

a/{\[a-z\]}/c/d

You can plug this in your favourite router that handles regular expressions matching - it will look at maching one rule instead of 3.

With a few hundred or thousand rules there is a noticeable increase in speed.

As long as your regular expressions don't span different url pieces (cointain slashes in them) you can use them. For instance this is not a good url to be used with this library: some/url{\[0-9\]/data}/download

Install
-------

[](#install)

- composer install with minimum-stability set at dev
- download the src/Filter.php and uset it

Usage
-----

[](#usage)

See test/FilterTest.php or test\_random\_benchmark/bench.php for usage examples

Performance
-----------

[](#performance)

Take a look into test\_random\_benchmark:. With 1000 random urls with 5-7 pieces of \[a-z\] or {regexp}, it takes around 2ms (0.0002s) to filter very obvious non-matching rules.

Work in progress
----------------

[](#work-in-progress)

Improvements to follow

- add more filtering
- better readme :)
- logging (although not sure it's needed?)

Any feedback is welcome

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![vladbabii](https://avatars.githubusercontent.com/u/4667916?v=4)](https://github.com/vladbabii "vladbabii (9 commits)")

### Embed Badge

![Health badge](/badges/vladbabii-leophpard/health.svg)

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

PHPackages © 2026

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