微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无效的正则表达式:/^(?:[\d]+|me$/: 升级 Wordpress 后未终止的组

如何解决无效的正则表达式:/^(?:[\d]+|me$/: 升级 Wordpress 后未终止的组

升级 WP 后,出现此错误

Uncaught SyntaxError: Invalid regular expression: /^(?:[\d]+|me$/: Unterminated group

我在文件 route-tree.js 中找到了这个

// A level's validate method is called to check whether a value being set
// on the request URL is of the proper type for the location in which it
// is specified. If a group pattern was found,the validator checks whether
// the input string exactly matches the group pattern.
var groupPatternRE = groupPattern === '' ?
    // If groupPattern is an empty string,accept any input without validation
    /.*/ :
    // Otherwise,validate against the group pattern or the component string
    new RegExp( groupPattern ? '^' + groupPattern + '$' : component,'i' );

如何从 route-tree.js 解决这个问题。因为如果我删除groupPattern ? '^' + groupPattern + '$' : component,'i',它就可以工作。那么我该如何解决这个问题?

提前致谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。