Lines Matching refs:match
492 $match = array();
499 while ( preg_match($pattern, $string, $match) )
503 $evalcond = !empty($entry[$match[1]]);
504 $then = count($match) > 3 ? 4 : 2;
505 $else = count($match) > 3 ? 5 : 3;
507 if ( $evalcond && count($match) > 3 ) {
508 if ( $match[2] === '==' ) {
509 $evalcond = $entry[$match[1]] === $match[3];
511 elseif ( $match[2] === '!=' ) {
512 $evalcond = $entry[$match[1]] !== $match[3];
514 elseif ( $match[2] === '<=' ) {
515 $evalcond = is_numeric($entry[$match[1]])
516 && is_numeric($match[3])
517 && (int)$entry[$match[1]] <= (int)$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 = preg_match('/'.$match[3].'/', $entry[$match[1]]) > 0;
531 $resolved = $match[$then];
533 elseif ( !empty($match[$else]) )
535 $resolved = $match[$else];
541 $string = str_replace($match[0], $resolved, $string);