An open API service indexing awesome lists of open source software.

https://github.com/redactedprofile/preg_match2

PHP's preg_match functions are great by themselves, but they only return a true or false value. I've always felt returning the matches themselves was a cleaner idea than updaing a reference passed empty array
https://github.com/redactedprofile/preg_match2

php preg regex

Last synced: about 1 year ago
JSON representation

PHP's preg_match functions are great by themselves, but they only return a true or false value. I've always felt returning the matches themselves was a cleaner idea than updaing a reference passed empty array

Awesome Lists containing this project

README

          

preg_match2
===========

Why?
---

I simply would prefer if the built in preg_match functions would just return the values
instead of the current method of supplying a predefined array.

Installation
---

`composer require redacteddevworks/preg_match2`

Usage
---

```
require 'autoload.php';

$matches = preg_match2('/([\d])/', 'the quick 1 jumped over the lazy 2 dog');
```