PHPackages                             jeyroik/preg - 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. jeyroik/preg

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

jeyroik/preg
============

Simple preg replace wrapper

1.3.1(7y ago)05051PHP

Since Dec 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jeyroik/preg)[ Packagist](https://packagist.org/packages/jeyroik/preg)[ RSS](/packages/jeyroik-preg/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (1)

preg
====

[](#preg)

Simple preg replace wrapper.

***Deprecated***. Moved to jeyroik/extas-foundation as [Replace](https://github.com/jeyroik/extas-foundation/blob/master/src/components/Replace.php).

Install
=======

[](#install)

composer require jeyroik/preg:1.0

Usage
=====

[](#usage)

```
use jeyroik\tools\components\Preg;

$s = 'Hello, @user.name! You hit this page @user.stat.hits times!';
$preg = new Preg();
echo $preg->apply([
  'user' => [
    'name' => 'JeyRoik',
    'stat' => [
      'hits' => 10
    ]
  ]
])->to($s);
```

Result will be:

```
Hello, JeyRoik! You hit this page 10 times!
```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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

Every ~109 days

Total

5

Last Release

2636d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aaec5c4bade6ab2b5d1a0f7d97ab4e0ff2ce83937f76499b2888ad16cde5e04?d=identicon)[jeyroik](/maintainers/jeyroik)

---

Top Contributors

[![jeyroik](https://avatars.githubusercontent.com/u/6348124?v=4)](https://github.com/jeyroik "jeyroik (1 commits)")

### Embed Badge

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

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

###  Alternatives

[tatter/settings

Lightweight settings management for CodeIgniter 4

239.9k3](/packages/tatter-settings)

PHPackages © 2026

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