Case-insensitivity in regex breaks CI only statement

Summary

Using a /i flag in an only: regex statement breaks regex matching.

Steps to reproduce

  1. Create a new project with a gitlab-ci.yml containing the following statements
build:
  only:
    - /^R\d+S\d+$/
    - /BRANCH/
  script:
    - echo "Hello World"
  1. Create a new branch called BRANCH
  2. Verify that the CI job is executing.
  3. Delete BRANCH branch
  4. Amend gitlab-ci.yml to the following
  only:
    - /^R\d+S\d+$/i
    - /BRANCH/i
  script:
    - echo "Hello World"
  1. Create BRANCH branch.
  2. Verify that the CI pipeline was not registered.

Example Project

https://gitlab.com/DylanBartlett/regex-test/

What is the current bug behavior?

Regex statements with the /i flag set do not work at all

What is the expected correct behavior?

Regex statement should match and become case insensitive.

Output of checks

This bug happens on GitLab.com

Edited by Dylan Bartlett