MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / getRegexp

Function getRegexp

scripts/replace-body.js:29–36  ·  view source on GitHub ↗
(re_str)

Source from the content-addressed store, hash-verified

27*/
28
29function getRegexp(re_str) {
30 let regParts = re_str.match(/^\/(.*?)\/([gims]*)$/)
31 if (regParts) {
32 return new RegExp(regParts[1], regParts[2])
33 } else {
34 return new RegExp(re_str)
35 }
36}
37
38let body
39if (typeof $argument == 'undefined') {

Callers 1

replace-body.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected