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

正则表达式 #156

Open
FrankKai opened this issue Jul 28, 2019 · 2 comments
Open

正则表达式 #156

FrankKai opened this issue Jul 28, 2019 · 2 comments
Labels

Comments

@FrankKai
Copy link
Owner

FrankKai commented Jul 28, 2019

  • 正则表达式速查表
  • JavaScript中的正则
  • 工作中遇到的正则表达式
@FrankKai
Copy link
Owner Author

FrankKai commented Jul 28, 2019

正则表达式速查表

image
https://regexr.com/

@FrankKai
Copy link
Owner Author

FrankKai commented Sep 28, 2020

JavaScript中的正则

  • String.prototype.replace() / replaceAll()
  • String.prototype.match() / matchAll()
  • String.prototype.search()
  • String.prototype.split()
  • RegExp object

工作中遇到的正则表达式

  • 匹配.jpg或.jpeg
    /\.jpe?g$/
  • 匹配11位手机号
    /1\d{10}/
  • 匹配尾缀0
    "12000".match(/0+$/) // ["000", index input group]

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