PHP code example of rkr / wildcards

1. Go to this page and download the library: Download rkr/wildcards 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/ */

    

rkr / wildcards example snippets



use Kir\StringUtils\Matching\Wildcards\Pattern;

(new Pattern('test.*'))->match('test.txt');      // true
Pattern::create('test.*')->match('test.txt');    // true
Pattern::create('*.txt')->match('test.txt');     // true
Pattern::create('*.*')->match('test.txt');       // true
Pattern::create('test*txt')->match('test.txt');  // true
Pattern::create('test?txt')->match('test.txt');  // true
Pattern::create('t*.???')->match('test.txt');    // true
Pattern::create('t*t?.txt')->match('test8.txt'); // true