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)05101PHP

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 2w 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 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

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

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

[crisu83/php-conversion

Library for converting units and sizes.

132326.2k1](/packages/crisu83-php-conversion)[pugx/shortid-php

An implementation of shortid in PHP

51606.9k3](/packages/pugx-shortid-php)[yii2mod/yii2-editable

Yii2 editable field extension

54407.7k11](/packages/yii2mod-yii2-editable)[neos/form

Extensible and flexible API for building web forms

18876.7k51](/packages/neos-form)[azuracast/nowplaying

A lightweight PHP adapter for viewing the current now playing data in Icecast and SHOUTcast 1/2. A part of the AzuraCast software suite.

2945.8k2](/packages/azuracast-nowplaying)[squareetlabs/laravel-openvidu

Laravel client for controlling your videocalls from your Openvidu server.

2710.8k](/packages/squareetlabs-laravel-openvidu)

PHPackages © 2026

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