js字符串提取中文、英文、数字

1. 提取中文 str.replace(/[^\u4E00-\u9FA5]/g,’’)

2. 提取英文 str.replace(/[^a-zA-Z]/g,’’)

3. 提取数字 str.replace(/[^\d]/g,’’)

 

posted @ 2022-10-13 15:27  黑白棋学弟  阅读(142)  评论(0编辑  收藏  举报