mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
10 lines
207 B
JavaScript
10 lines
207 B
JavaScript
const regexTransform = (text, regex, replacement) => {
|
|
if (replacement) {
|
|
return text.replace(regex, replacement);
|
|
} else {
|
|
return text.match(regex);
|
|
}
|
|
};
|
|
|
|
module.exports = { regexTransform };
|