Hi,
I'm trying to set branch permissions up, using branch pattern, however it doesn't appear to be working as expected.
I want to create a permission so that branches with the following naming convention cannot be deleted or directly written too (only via pull request).
I thought the branch pattern to match this would be: 'develop_?.?' which should match 'develop_' then a single character, followed by a dot and another single character.
I have tried this and it is not working. In BitBucket if you set up conflicting rules then it should give the user a warning (i've tested this against other branch patterns and it does). As a test I set up a rule for 'develop_?.?' and one for 'develop_3.0' however I don't see any warnings about conflicting rules, which leads me to believe my branch pattern is wrong, however I can't see the problem.
Hi Christopher,
Can you try with the following patter?
develop_\d+\.\d+
There are some online tools to validate regex (for example https://regexr.com/). If you enter the regex above in one of them, they will also provide a detailed explanations of the rule.
For example \d matches any digit character (0-9). Equivalent to [0-9]
.
I changed the regex to be more specific about the branch pattern and restrict the checks only on the branches following the structure in your example. This may not be required, while escaping the . using \. seems to be the missing part.
Cheers,
Caterina - Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.