Change sed search regex to be compatible with BSD sed (#14233)