Исправления багов поиска по рег. выражению

This commit is contained in:
Book Pauk
2022-12-09 18:31:41 +07:00
parent 85bf7296ef
commit bd2551559b
3 changed files with 8 additions and 8 deletions

View File

@@ -391,8 +391,8 @@ export default class BaseList {
} else if (searchValue[0] == '~') {//RegExp
searchValue = searchValue.substring(1);
const re = new RegExp(searchValue, 'gi');
return re.exec(bookValue);
const re = new RegExp(searchValue, 'i');
return re.test(bookValue);
} else {
//where = `@dirtyIndexLR('value', ${db.esc(a)}, ${db.esc(a + maxUtf8Char)})`;
return bookValue.localeCompare(searchValue) >= 0 && bookValue.localeCompare(searchValue + maxUtf8Char) <= 0;