Download the PHP package yuanqing/extract without Composer
On this page you can find all versions of the php package yuanqing/extract. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yuanqing/extract
More information about yuanqing/extract
Files in yuanqing/extract
Package extract
Short Description Sugar for getting data out of strings in PHP.
License MIT
Homepage https://github.com/yuanqing/extract
Informations about the package extract
Extract.php
Regex sugar for getting data out of strings:
Boom.
Usage
-
If the given string does not match the required format,
null
is returned. -
Each capturing group is enclosed in double braces. Within said braces, we have:
- The name of the capturing group
- (optional) A character length
- (optional) A type specifier
-
A capturing group can be an arbitrary string (
s
): -
...or an integer (
d
): - ...or a float (
f
):
All the examples in this README are in the examples.php file. You can also find more usage examples in the tests.
Requirements
Extract.php requires at least PHP 5.3, or HHVM.
Installation
Install with Composer
-
Install Composer.
-
Install the Extract.php Composer package:
- In your PHP, require the Composer autoloader:
Install manually
-
Clone this repository:
Or just grab the zip.
- In your PHP, require Extract.php:
Testing
You need PHPUnit to run the tests:
License
MIT license