3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '42 = 42 OR `1+1:3 * 4/2 = 1 \ abc` =2 AND field1=2 AND `column_x` <> "lorem 1" OR a= \'2_\' AND '; echo json_encode((bool)preg_match( '/^('. '(?:`?\w+`?|`[\w+=:\/\*\-\\\ ]+`)\s*'. // column name '([!><]?=|[><]|<>)\s*'. // operator '([\'"][\w\s\.\,]+[\'"]|\d+(\.\d+)?)'. // value '(\s+(AND|OR)\s+)'. // logical operator ')+$/i', $str));
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.28 - 7.3.0rc3
true