Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
391 views
in Technique[技术] by (71.8m points)

js中的正则支持条件匹配吗

?(子表达式)需要执行的表达式
例:(abc)2333(?(1)w)

只有在子表达式匹配成功的情况下才匹配后面的表达式,js支持这种写法吗,试了下直接报错啊。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

很遗憾,目前Javascript是不支持的。 C#, php, python等都支持这个高级语法。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...