Improved String#to_foorth_n with better regexp.