Created
November 4, 2021 03:37
-
-
Save luojiyin1987/5c0146578c6e1c19b9c2b15e5f0c0997 to your computer and use it in GitHub Desktop.
通过正则回溯 进行词的匹配
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function spinalCase(str) { | |
| return str | |
| .split(/\s|_|(?=[A-Z])/) | |
| .toLowerCase(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment