Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

switer opened this issue Mar 5, 2014 · 2 comments

Comments

@switer
Copy link

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

@army8735
Copy link
Member

army8735 commented Mar 5, 2014

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

@switer
Copy link
Author

switer commented Mar 5, 2014

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

@army8735 army8735 closed this as completed Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants