funch/re

regular expression

1.0.0 2016-12-13 04:01 UTC

This package is not auto-updated.

Last update: 2024-05-06 12:03:26 UTC


README

<?php

use Funch\ReStatic as Re;

$text = 1234;

echo Re::pattern('12')
    ->subject($text)
    ->replace(56); // 5634

print_r(
    Re::subject([
        $text,
        'hello, PHP'
    ])->replace([
        '/12/' => '00',
        '/php/i' => 'China'
    ])
);
// Array
// (
//     [0] => 0034
//     [1] => hello, China
// )