Wouldn't it be faster to use substr in the first place and prevent the regex at all?