Config "only" with regexp

We are using version tags, like this: 0.2.1 I tried this regex:

deploy:auto:prod:
    # ...
    only:
        - /^v?[\d\.]+$/

It doesn’t work, and I don’t find any information anywhere about how regexp works in Gitlab. It should be “bash regexp format”? Or why doesn’t work well?