Validate correct serialization of regexp with /gi by adding test