Compatibility with BSD version of `sed'

Rewrite calls to `sed' that make use of '-r' option. This option is implemented by GNU `sed', but not compatible with BSD `sed'.

Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>