数字千分位正则表达式
时间: 2023-10-20 12:35:41 浏览: 177
数字千分位正则表达式是 /(\d)(?=(?:\d{3})+$)/g。这个表达式的含义是匹配每个数字后面的位置,该位置后面跟着3个数字的倍数个数。它使用了正则表达式的零宽正向预查,即(?=pattern)。这个表达式可以用来给数字添加千分位,例如将数字12345678转换为"12,345,678"。 <span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>
#### 引用[.reference_title]
- *1* *4* [正则表达式 - 千分位分隔符](https://blog.csdn.net/weixin_40161974/article/details/103156879)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [JS正则实现数值千分位](https://blog.csdn.net/MessageBox_/article/details/81513470)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文