Replace sed command with linux and OSX-friendly perl expression.

Bugs closed: AURORA-344

Reviewed at https://reviews.apache.org/r/20571/