Exclude builds using wildcards

This is my build matrix -

  matrix:
    compiler: ['gcc-5', 'gcc-6', 'gcc-8', 'gcc-9', 'clang-4', 'clang-7', 'clang-8', 'clang-9', 'clang-10', 'clang-11']
    build-runtime: ['5.0', '6.0', '7.0', '8.0', '9.0', '10.0', '11.0']
    os: [ubuntu-latest, macos-latest]
    exclude:
      - compiler: gcc*
        os: macos-latest

But I am still having builds with ${{ matrix.os }} = 'macos-latest' and ${{ matrix.os }} = gcc-*. How could I fix this?