i'm trying to set rules for set branches on my repo, but having issues with the pattern to apply only to specific branches. ie rule to apply only to brances master,develop,release
Issue: the pattern isn't picking up the wrong branches
I tried looking through here, but it's working as expected https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch
I've tried, but not working with 0 branches or everything selected:
{^.*(master).*$,^.*(develop).*$}
[master,develop,release]
[master;develop;release]*
ps this one dose the opposite an applied all brances, but the listed ones:
*[!master|!develop|!release]*

As johnfo says in a comment, GitHub's branch protection rule patterns are not regular expressions. In fact, the GitHub documentation mentions that they are specifically Ruby File::FNM_PATHNAME style expressions. This is highly specific (Git itself uses no Ruby code at all).
I snipped the git tag; curiously, you included fnmatch yourself, which is the right tag for someone who might like to supply the right Ruby expressions here. It looks like GitHub do not set the
FNM_EXTMATCHflag, so you probably need multiple match expressions (also noted in the comment above). I wouldn't bother answering except that it seemed useful to add some links.