Utilize full branch name when checking permissions.

The regular expression for branch names was too limited and didn't account for the commonly used <slash>.