Use RE to select branches

Signed-off-by: Michael Barton <mail@michaelbarton.me.uk>