Lines Matching refs:match
180 $match = [];
187 while (preg_match($pattern, $string, $match)) {
190 $evalcond = !empty($entry[$match[1]]);
191 $then = count($match) > 3 ? 4 : 2;
192 $else = count($match) > 3 ? 5 : 3;
194 if ( $evalcond && count($match) > 3 ) {
195 if ( $match[2] === '==' ) {
196 $evalcond = $entry[$match[1]] === $match[3];
198 elseif ( $match[2] === '!=' ) {
199 $evalcond = $entry[$match[1]] !== $match[3];
201 elseif ( $match[2] === '<=' ) {
202 $evalcond = is_numeric($entry[$match[1]])
203 && is_numeric($match[3])
204 && (int)$entry[$match[1]] <= (int)$match[3];
206 elseif ( $match[2] === '>=' ) {
207 $evalcond = is_numeric($entry[$match[1]])
208 && is_numeric($match[3])
209 && (int)$entry[$match[1]] >= (int)$match[3];
211 elseif ( $match[2] === '~' ) {
212 $evalcond = preg_match('/'.$match[3].'/', $entry[$match[1]]) > 0;
218 $resolved = $match[$then];
220 elseif ( !empty($match[$else]) )
222 $resolved = $match[$else];
228 $string = str_replace($match[0], $resolved, $string);