Use regexs instead of exploding in more places.