Lines Matching refs:match
497 $match = array();
504 while ( preg_match($pattern, $string, $match) )
508 $evalcond = !empty($entry[$match[1]]);
509 $then = count($match) > 3 ? 4 : 2;
510 $else = count($match) > 3 ? 5 : 3;
512 if ( $evalcond && count($match) > 3 ) {
513 if ( $match[2] === '==' ) {
514 $evalcond = $entry[$match[1]] === $match[3];
516 elseif ( $match[2] === '!=' ) {
517 $evalcond = $entry[$match[1]] !== $match[3];
519 elseif ( $match[2] === '<=' ) {
520 $evalcond = is_numeric($entry[$match[1]])
521 && is_numeric($match[3])
522 && (int)$entry[$match[1]] <= (int)$match[3];
524 elseif ( $match[2] === '>=' ) {
525 $evalcond = is_numeric($entry[$match[1]])
526 && is_numeric($match[3])
527 && (int)$entry[$match[1]] >= (int)$match[3];
529 elseif ( $match[2] === '~' ) {
530 $evalcond = preg_match('/'.$match[3].'/', $entry[$match[1]]) > 0;
536 $resolved = $match[$then];
538 elseif ( !empty($match[$else]) )
540 $resolved = $match[$else];
546 $string = str_replace($match[0], $resolved, $string);