PHP code example of chevere / regex

1. Go to this page and download the library: Download chevere/regex library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

chevere / regex example snippets


use Chevere\Regex\Regex;

$regex = new Regex('/^Hello World!$/');

$string = $regex->__toString();
// /^Hello World!$/

$string = $regex->noDelimiters();
// ^Hello World!$

$string = $regex->noDelimitersNoAnchors();
// Hello World!

$array = $regex->match('Hello World!');
// [Hello World!]

$regex->matchAll();
// [Hello World!]

$regex->assertMatch('Hello World!');

$regex->assertMatchAll('Hello World!');