正则表达式匹配逗号分隔的字符串 - java - 方帮信


大厂面试直通卡 本周拉勾免费课:《深入浅出搞定React》 7月6号下线 【腾讯云】2021新春采购节,爆款产品特惠,助力企业上云
当前位置: 首页 >  > 技术 > 软件开发 > java

正则表达式匹配逗号分隔的字符串

2021/7/15 18:55:14 浏览

正则表达式匹配逗号分隔的字符串var a = hi,mr.007,bond,12:25PM//"hi,mr.007,bond,12:25PM"var b=/([^,]+)/ga.match(b)// ["hi", "mr.007", "bond", "12:25PM"]/([^,]+)/g(图片来自:https://www.w3schools.com/pyt…

站长送干货喽:

1.拉勾教育7天VIP

2.大场面试题第一季-阿里篇视频讲解

站长的微信:changyandoublog

正则表达式匹配逗号分隔的字符串

var a = 'hi,mr.007,bond,12:25PM'
//"hi,mr.007,bond,12:25PM"
var b=/([^,]+)/g
a.match(b)
// ["hi", "mr.007", "bond", "12:25PM"]
/([^,]+)/g

image-20210706094503467image-20210706094503467.png

(图片来自:https://www.w3schools.com/python/python_regex.asp

https://stackoverflow.com/questions/15143867/javascript-regex-splitting-words-in-a-comma-separated-string/15143963

https://stackoverflow.com/questions/16620980/comma-separated-numbers-regex



来源:方帮信(微信:changyandoublog,邮箱:changyandou@126.com),欢迎分享!