diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index 4598e8ccc5..e34ac52a02 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -5,7 +5,7 @@ module.exports = (_ => { "info": { "name": "BDFDB", "author": "DevilBro", - "version": "1.0.5", + "version": "1.0.6", "description": "Gives other plugins utility functions." }, "rawUrl": "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", @@ -3598,6 +3598,11 @@ module.exports = (_ => { }); return string || original; }; + BDFDB.StringUtils.findMatchCaseless = function (match, string) { + if (typeof match != "string" || typeof string != "string") return ""; + let exec = (new RegExp(`([\n\r\s]+${match}[\n\r\s]+)|([\n\r\s]+${match}$)|(^${match}[\n\r\s]+)|(^${match}$)`, "i")).exec(string); + return exec && typeof exec[0] == "string" && exec[0].replace(/[\n\r\s]/g, "") || ""; + }; BDFDB.StringUtils.extractSelection = function (original, selection) { if (typeof original != "string") return ""; if (typeof selection != "string") return original;