Abstract some code into self-contained BREtoRegExp function.
Add posixbre as external module, so that it can be shared.