$regex) { if (empty($regex) || substr($regex, 0, 1) == "#") { continue; } if (empty($regex) || substr($regex, 0, 1) != "/") { echo json_encode(array('type' => 'danger', 'msg' => 'Line ' . ($line + 1) . ': Invalid regex')); exit(); } if (@preg_match($regex, 'Lorem Ipsum') === false) { echo json_encode(array('type' => 'danger', 'msg' => 'Line ' . ($line + 1) . ': Invalid regex "' . $regex . '"')); exit(); } } echo json_encode(array('type' => 'success', 'msg' => $lang['add']['validation_success'])); } ?>