PHPackages                             james2doyle/common-regex-php - 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. james2doyle/common-regex-php

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

james2doyle/common-regex-php
============================

Find a lot of kinds of common information in a string

3142PHP

Since Jan 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/james2doyle/CommonRegexPHP)[ Packagist](https://packagist.org/packages/james2doyle/common-regex-php)[ RSS](/packages/james2doyle-common-regex-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CommonRegexPHP
==============

[](#commonregexphp)

> Migrated from [talyssonoc/CommonRegexJS](https://github.com/talyssonoc/CommonRegexJS)

[CommonRegex](https://github.com/madisonmay/CommonRegex/ "CommonRegex") port for PHP

Find a lot of kinds of common information in a string.

Pull requests welcome!

Please note that this is currently English/US specific.

Usage
=====

[](#usage)

```
composer require james2doyle/common-regex-php

```

Then somewhere in the code:

```
$parser = new CommonRegexPHP;
$results = $parse('See you at 12:00AM on March 22nd 2018');
// returns [
//     'dates' => [
//         'March 22nd 2018',
//     ],
//     'times' => [
//         '12:00AM',
//     ],
// ]

// shorthand
$results = (new CommonRegexPHP)('See you at 12:00AM on March 22nd 2018');
```

Running Tests
=============

[](#running-tests)

```
composer install
composer run test

```

CommonRegex Ports
=================

[](#commonregex-ports)

There are CommonRegex ports for other languages, see [here](https://github.com/madisonmay/CommonRegex/#commonregex-ports "CommonRegex ports")

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

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.

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

datesparsingphpregexstringtimes

### Embed Badge

![Health badge](/badges/james2doyle-common-regex-php/health.svg)

```
[![Health](https://phpackages.com/badges/james2doyle-common-regex-php/health.svg)](https://phpackages.com/packages/james2doyle-common-regex-php)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M283](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M344](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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