diff --git a/ui/pages/settings/settings-search/settings-search.js b/ui/pages/settings/settings-search/settings-search.js index 6f37e399c..545068aa5 100644 --- a/ui/pages/settings/settings-search/settings-search.js +++ b/ui/pages/settings/settings-search/settings-search.js @@ -42,10 +42,9 @@ export default function SettingsSearch({ }); const handleSearch = (_searchQuery) => { - const sanitizedSearchQuery = _searchQuery.replace( - /[^A-z0-9\s&]|[\\]/gu, - '', - ); + const sanitizedSearchQuery = _searchQuery + .replace(/[^A-Za-z0-9\s&_]/gu, '') + .trim(); setSearchQuery(sanitizedSearchQuery); if (sanitizedSearchQuery === '') { setSearchIconColor('var(--color-icon-muted)');