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

RegExp tips #421

Open
JounQin opened this issue Feb 19, 2022 · 0 comments
Open

RegExp tips #421

JounQin opened this issue Feb 19, 2022 · 0 comments
Labels

Comments

@JounQin
Copy link
Owner

JounQin commented Feb 19, 2022

  1. *?/+? 将启用懒匹配模式,即匹配最短符合规则的字符串即停止匹配,而默认情况下是尽可能多得匹配。

例如:

'<abc>x</abc>'.match(/<.+?>/)[0] // '<abc>'

'<abc>x</abc>'.match(/<.+>/)[0] // '<abc>x</abc>'
@JounQin JounQin added the notes label Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant