python 過濾字母、標點等 保留數字

crazystring = ‘dade142.;!0142f[.,]ad’html 只保留數字 >>> filter(str.isdigit, crazystring) ‘1420142’python 只保留字母 >>> filter(str.isalpha, crazystring) ‘dadefad’git 只保留字母和數字 >>> filter(str.isalnum, crazystrin
相關文章
相關標籤/搜索