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

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

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

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

 

posted @ 2023-08-29 16:57  LoveMe7788  阅读(1043)  评论(0编辑  收藏  举报