Use slice instead of regex as per @xaka suggestion