Skip to content

Commit

Permalink
fix(nameRegex): accept trailing spaces (#141)
Browse files Browse the repository at this point in the history
Co-authored-by: Aleksandar Sredojević <[email protected]>
  • Loading branch information
readmemyrights and Aleksandar Sredojević authored Jan 15, 2025
1 parent 6132495 commit 7008715
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/utils/regexp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { env } from '$env/dynamic/public';

export const nameRegExp = /^[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+(?:(?:\s|-)[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+)?$/;
export const nameRegExp = /^[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+(?:(?:\s|-)[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+)?\s*$/;
export const nameRegExpMsg = 'String must be 1-2 word(s) seperated by space or dash (-)';

export const indexRegExp = new RegExp(
Expand Down

0 comments on commit 7008715

Please sign in to comment.