replace regex with #split and #last