Skip to content

Commit

Permalink
fix inconsistent results in search when using regex
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <[email protected]>
  • Loading branch information
mblaschke committed Aug 22, 2024
1 parent fe29084 commit 0dcb6dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,17 @@ let refreshTableFilter = () => {
}

let valueRegexString = "^" + resourceNameRegexpString + ":[\\s]*" + resourceValueRegexpString + ".*$";
let valueRegex = new RegExp(valueRegexString, "gim");
let valueRegex = new RegExp(valueRegexString, "im");
reportFilter.push({field: fieldName, type: "regex", value: valueRegex});
} else if (value.startsWith("/") && value.endsWith("/")) {
// fulltext search: regex
let valueRegexString= "^.*" + searchValueRegexToRegexString(value) + ".*$";
let valueRegex = new RegExp(valueRegexString, "gim");
let valueRegex = new RegExp(valueRegexString, "im");
reportFilter.push({field: fieldName, type: "regex", value: valueRegex});
} else if (value.startsWith("[") && value.endsWith("]")) {
// fulltext search: list
let valueRegexString= "^.*" + searchValueArrayToRegexString(value) + ".*$";
let valueRegex = new RegExp(valueRegexString, "gim");
let valueRegex = new RegExp(valueRegexString, "im");
reportFilter.push({field:fieldName, type:"regex", value:valueRegex});
} else {
// fulltext search: like
Expand Down

0 comments on commit 0dcb6dd

Please sign in to comment.