seajs源码中的这句正则是否写错了? #1122

Closed
switer opened this Issue Mar 5, 2014 · 2 comments

Comments

Projects
None yet
2 participants

switer commented Mar 5, 2014

var DIRNAME_RE = /[^?#]*\//
// "a/b/c.js?t=123#xx/zz") ==> "a/b/"

?在正则表达式中的含义让人迷惑,正确的写法应该:/[^?#]*//
https://github.com/seajs/seajs/blob/master/dist/sea-debug.js#L103

Owner

army8735 commented Mar 5, 2014

perl风格的正则表达式中,[]字符集中可以省略转义符

switer commented Mar 5, 2014

@army8735 验证过javascript也是支持这种写法的,thanks~!

army8735 closed this Mar 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment