Short for regular expression, a regex is a string of text that lets you create patterns that help match, locate, and manage text.


Wildcard search in array with regex in PHP

$array = array('Michael','Marian','Martina');
$matching_letters = 'ri'; 
$array = preg_grep("/{$matching_letters}/i", $array);

Websites for regex pattern matching 

Leave a Reply

Your email address will not be published. Required fields are marked *