3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = "(Field1 = 'Val and ue1') and (Field2 = 'Valu or e2') or (Field3 = 'Value3')"; preg_match_all('~(?:^\(|\G(?!^)(?:\) | \())\K(?:(?:and|or)|[^)]+)~', $input, $m); print_r($m[0]);

preferences:
65.03 ms | 1273 KiB | 5 Q