Download Fore_End/cpcn2/node_modules/escape-string-regexp/index.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 226 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/escape-string-regexp/index.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/escape-string-regexp/index.js
-
curl -L -o index.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/escape-string-regexp/index.js
226 Bytes
| ; | |
| var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; | |
| module.exports = function (str) { | |
| if (typeof str !== 'string') { | |
| throw new TypeError('Expected a string'); | |
| } | |
| return str.replace(matchOperatorsRe, '\\$&'); | |
| }; | |