PHPackages                             mck89/rebuilder - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. mck89/rebuilder

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

mck89/rebuilder
===============

REBuilder is a PHP library to build and parse regular expressions

29PHP

Since Sep 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mck89/rebuilder)[ Packagist](https://packagist.org/packages/mck89/rebuilder)[ RSS](/packages/mck89-rebuilder/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

REBuilder
=========

[](#rebuilder)

REBuilder is a PHP 5.3+ library to build and parse regular expressions

Installation
------------

[](#installation)

Include the following requirement to your composer.json:

```
{
	"require": {
		"mck89/rebuilder": "dev-master"
	}
}

```

Run `composer install` and include the autoloader:

```
require_once "vendor/autoload.php";
```

Parse
-----

[](#parse)

REBuilder's parser builds a tree structure starting from a regular expression. For example this code:

```
//Parse the regular expression
$regex = REBuilder\REBuilder::parse("/parse\s+me/");
```

Generates this structure:

```
REBuilder\Pattern\Regex
    getStartDelimiter() => "/"
    getEndDelimiter() => "/"
    getChildren() => array(
        REBuilder\Pattern\Char
            getChar() => "parse"

        REBuilder\Pattern\GenericCharType
            getIdentifier() => "s"
            getRepetition() => REBuilder\Pattern\Repetition\OneOrMore

        REBuilder\Pattern\Char
            getChar() => "me"
    )

```

Build
-----

[](#build)

REBuilder allows you to build regular expressions with object oriented PHP:

```
//Create an empty regular expression object
$regex = REBuilder\REBuilder::create();

$regex->addCharAndContinue("parse")
      ->addGenericCharType("s")
          ->setRepetition("+")
          ->getParent()
      ->addCharAndContinue("me");

echo $regex->render(); //"/parse\s+me/"
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

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/d80aaab62ed0d1a3d39fe7e3d8fca53855514e6503d704182cc4d7f0346fd9ba?d=identicon)[mck89](/maintainers/mck89)

---

Top Contributors

[![mck89](https://avatars.githubusercontent.com/u/466041?v=4)](https://github.com/mck89 "mck89 (73 commits)")

---

Tags

ast-generationparserphpregexregular-expressionsyntax-treevalidator

### Embed Badge

![Health badge](/badges/mck89-rebuilder/health.svg)

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[karriere/json-decoder

JsonDecoder implementation that allows you to convert your JSON data into PHP class objects

140439.4k12](/packages/karriere-json-decoder)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[json-mapper/laravel-package

The JsonMapper package for Laravel

25188.9k3](/packages/json-mapper-laravel-package)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)

PHPackages © 2026

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