diff --git a/lib/db/utils.js b/lib/db/utils.js index af722bb18b..96563ff1d7 100644 --- a/lib/db/utils.js +++ b/lib/db/utils.js @@ -11,9 +11,9 @@ function extractDatabaseChangeFromUse(sql) { // The character ranges for this were pulled from // http://dev.mysql.com/doc/refman/5.7/en/identifiers.html - // Suppressing a warning on this regex because it is not obvious what this - // regex does, and we don't want to break anything. - // eslint-disable-next-line sonarjs/slow-regex, sonarjs/duplicates-in-character-class - const match = /^\s*use[^\w`]+([\w$_\u0080-\uFFFF]+|`[^`]+`)[\s;]*$/i.exec(sql) + // The lint rule being suppressed here has been evaluated, and it has been + // determined that the regular expression is sufficient for our use case. + // eslint-disable-next-line sonarjs/slow-regex + const match = /^\s*use[^\w`]+([\w$\u0080-\uFFFF]+|`[^`]+`)[\s;]*$/i.exec(sql) return (match && match[1]) || null }