Create S3 Bucket with AllowedPattern

In the serverless.yml file under the resources section I am creating a S3 bucket it works but now I want to make it better by adding the AllowedPattern to only allow images in to the bucket but I keep getting the following error (is it just because I don’t know what kinds of regex it is looking for?)

Serverless: Deprecation warning: Variables resolver reports following resolution errors:
- Cannot resolve variable at “resources.Resources”: Cannot parse “config/resource.yml”: unknown escape sequence in “/codebuild/output/src951772159/src/config/resource.yml” (24:24)

         21 |   Properties:
         22 |     BucketName: '${env:STAGE}-${self:custom.imageUploa ...
         23 |     AccessControl: PublicRead
         24 |     AllowedPattern: "/\.(gif|jpe?g|tiff?|png|webp|bmp)"/ig
        -----------------------------^

This is part of the serverless.yml file

ImageUploadBucket:
Type: ‘AWS::S3::Bucket’
Properties:
BucketName: ‘${env:STAGE}-${self:custom.imageUploadBucket}’
AccessControl: PublicRead
AllowedPattern: “/.(gif|jpe?g|tiff?|png|webp|bmp)”/ig
CorsConfiguration:
CorsRules: