const r=/\/(?<expression>.+)\/(?<flags>[a-z]*)/i;function e(e){if(e.startsWith("/")){const n=e.match(r);if(null==n)throw new Error("invalid regular expression format");const{expression:s,flags:t}=n.groups,i=Array.from(new Set(t)).filter((r=>"dgimsuy".includes(r))).join("");return new RegExp(s,i)}return new RegExp(e)}export{e as parseRegex};
//# sourceMappingURL=regex-parse.js.map
