-
Notifications
You must be signed in to change notification settings - Fork 819
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
我有更好的正则: html注释 #20
Comments
十分感谢指正了2处错误 👍 "html注释以-->结束,可以在中间"这句没懂, 什么可以在中间? |
因为你原本的正则是 |
/<!--(.*?)-->/.test(`<!-- <a>123</a> -->123`) // true 为了避免这种情况 |
避免?我知道了,你应试是要求输入的整个字符串都是html注释是吧 /<!--(.*?)-->$/.test(`123<!-- <a>123</a> -->`) //true |
是的^忘记写了.多谢哦😯 |
any86
added a commit
that referenced
this issue
Aug 5, 2019
* origin/master: fix: 修复"html注释"缺少的"^" (#20) Update README.md Update README.md Update README.md [ImgBot] Optimize images # Conflicts: # packages/www/src/RULES.js
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
html的注释正则应该是
/<!--[\s\S]*?-->/
html注释以
-->
结束,可以在中间,另外注释中可以回车换行,.
并不匹配换行The text was updated successfully, but these errors were encountered: