下面是一个非常简单的正则表达式代码,它在PHP和
ruby中正常工作,但在JS中却没有.请求帮助我让它工作:
var r = /:[a-z]+/ var s = '/a/:b/c/:d' var m = r.exec(s) // now m is [":b"] // it should be [":b",":d"] // because that's what i get in ruby and PHP