Lines Matching refs:match
471 $match = array();
478 while ( preg_match($pattern, $string, $match) )
482 $evalcond = !empty($entry[$match[1]]);
483 $then = count($match) > 3 ? 4 : 2;
484 $else = count($match) > 3 ? 5 : 3;
486 if ( $evalcond && count($match) > 3 ) {
487 if ( $match[2] === '==' ) {
488 $evalcond = $entry[$match[1]] === $match[3];
490 elseif ( $match[2] === '!=' ) {
491 $evalcond = $entry[$match[1]] !== $match[3];
493 elseif ( $match[2] === '<=' ) {
494 $evalcond = is_numeric($entry[$match[1]])
495 && is_numeric($match[3])
496 && (int)$entry[$match[1]] <= (int)$match[3];
498 elseif ( $match[2] === '>=' ) {
499 $evalcond = is_numeric($entry[$match[1]])
500 && is_numeric($match[3])
501 && (int)$entry[$match[1]] >= (int)$match[3];
503 elseif ( $match[2] === '~' ) {
504 $evalcond = preg_match('/'.$match[3].'/', $entry[$match[1]]) > 0;
510 $resolved = $match[$then];
512 elseif ( !empty($match[$else]) )
514 $resolved = $match[$else];
520 $string = str_replace($match[0], $resolved, $string);