TextReplace: support /v regex flag

This commit is contained in:
Vendicated 2024-06-28 16:04:51 +02:00
parent 484d70fb15
commit e4bf71784e
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -77,7 +77,7 @@ const settings = definePluginSettings({
});
function stringToRegex(str: string) {
const match = str.match(/^(\/)?(.+?)(?:\/([gimsuy]*))?$/); // Regex to match regex
const match = str.match(/^(\/)?(.+?)(?:\/([gimsuyv]*))?$/); // Regex to match regex
return match
? new RegExp(
match[2], // Pattern