Compatibility with OSX

Hi,

Thanks for writing this tool and making it public, saved me shaving one more yak!

Just a small tweak, since on the version of grep I have on osx (might be via homebrew) the -P option is not available. My research indicates that -E should be available on most versions of grep - if not, or if I've missed an edge case, please reject the request as I'd rather not mess up this very useful script for others.

Thanks again,
Matthew
Branch names shouldn't have a \r in them, I don't think, as the original regex matches anything but whitespace.