Wrong regex while cleaning queries