Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/james2doyle/commonregexphp
Find a lot of kinds of common information in a string
https://github.com/james2doyle/commonregexphp
dates parsing php regex string times
Last synced: 5 days ago
JSON representation
Find a lot of kinds of common information in a string
- Host: GitHub
- URL: https://github.com/james2doyle/commonregexphp
- Owner: james2doyle
- License: mit
- Created: 2019-01-21T06:27:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T06:31:36.000Z (almost 6 years ago)
- Last Synced: 2024-04-14T14:57:22.797Z (7 months ago)
- Topics: dates, parsing, php, regex, string, times
- Language: PHP
- Size: 11.7 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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
======```
composer require james2doyle/common-regex-php
```Then somewhere in the code:
```php
$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](https://github.com/madisonmay/CommonRegex/#commonregex-ports "CommonRegex ports")