We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
如果想要重复匹配多个字符该怎么办?这里可以用小括号来指定子表达式(也叫做分组).
需要匹配xi,并分组
xi
const str = 'xixixi xii xix'
/(xi)+/g
关键字的匹配一般使用锚点(即该关键字)进行匹配,这里使用xi,括号即捕获
str.match(/(xi)+/g) // ["xixixi", "xi", "xi"]
在线测试
The text was updated successfully, but these errors were encountered:
No branches or pull requests
聊聊捕获组
如果想要重复匹配多个字符该怎么办?这里可以用小括号来指定子表达式(也叫做分组).
问题
需要匹配
xi
,并分组正则
/(xi)+/g
在线测试
The text was updated successfully, but these errors were encountered: