lyteworx / common-regex2-php
Find a lot of kinds of common information in a string
Installs: 71
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 2
pkg:composer/lyteworx/common-regex2-php
Requires (Dev)
- phpunit/phpunit: ^7.1
This package is auto-updated.
Last update: 2025-12-25 06:07:09 UTC
README
Forked from james2doyle/CommonRegexPHP (https://github.com/james2doyle/CommonRegexPHP)
Adding Additional Regex searches.
Migrated from talyssonoc/CommonRegexJS
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
composer require lyteworx/common-regex2-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
composer install
composer run test
CommonRegex Ports
There are CommonRegex ports for other languages, see here