mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-14 22:54:32 +08:00
为大部分命令添加输出结构结构化数据
This commit is contained in:
9
plugin/lib/quickcomposer/data/regexTransform.js
Normal file
9
plugin/lib/quickcomposer/data/regexTransform.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const regexTransform = (text, regex, replacement) => {
|
||||
if (replacement) {
|
||||
return text.replace(regex, replacement);
|
||||
} else {
|
||||
return text.match(regex);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { regexTransform };
|
||||
Reference in New Issue
Block a user