Add missing flags to query regex replace