Add support for filtering text by "length" <= >= < >

This commit is contained in:
Bofh 2022-12-25 20:50:52 +01:00
parent 006067e851
commit 37313a4e9d
1 changed files with 7 additions and 0 deletions

View File

@ -742,6 +742,13 @@ function matches_comparing_expression($expr, $o_text, $debug=false) {
echo '<br>';
}
break;
case 'len':
case 'length':
case 'size':
$bool = false;
if (preg_match('/^(\<|\>)\=?\s*\d+$/', $content))
eval('$bool = strlen($o_text) '.$content.';');
break;
}
$result = str_replace($t, $bool ? 'true' : 'false', $result);