Skip to content

Commit

Permalink
Removed unnecessary character escapes
Browse files Browse the repository at this point in the history
  • Loading branch information
Liubov Zatsepina committed Nov 28, 2024
1 parent cb6daf4 commit bd15772
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class SearchbarComponent implements OnInit, OnDestroy {
}

public handleInvalidCharacter(value: string): void {
const validValue = value?.replace(/[^A-Za-zА-Яа-яІіЇїЄєҐґ0-9`.,№"\'\s]/g, '');
const validValue = value?.replace(/[^A-Za-zА-Яа-яІіЇїЄєҐґ0-9`.,№"'\s]/g, '');
if (validValue !== value) {
this.searchValueFormControl.setValue(validValue);
this.invalidCharacterDetected.emit();
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/constants/regex-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export const SECTION_NAME_REGEX: RegExp = /^(?!`)(?!\^)(?!_)(?!\[)(?!])(?!\\)[А
export const MUST_CONTAIN_LETTERS: RegExp = /[a-zA-ZА-ЯЄІЇҐа-яґєії]/;

// Regex for searchbar
export const SEARCHBAR_REGEX: RegExp = /^[A-Za-zА-Яа-яІіЇїЄєҐґ0-9`.,№"\'\\s]*$/;
export const SEARCHBAR_REGEX: RegExp = /^[A-Za-zА-Яа-яІіЇїЄєҐґ0-9`.,№"'\\s]*$/;

0 comments on commit bd15772

Please sign in to comment.