Regex

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

Examples

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

Regex101.com 
PHPLiveRegex.com 

Leave a Reply

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