Skip to content

Commit cca3788

Browse files
relax validation of names, to allow special characters, apostrophes and hyphens
1 parent 48720b3 commit cca3788

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/Organisms/shared/emailSignup/emailSignupConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ const buildEsuValidationSchema = overrides => {
3434
.string()
3535
.required('Please enter your first name')
3636
.matches(
37-
/^[A-Za-z][A-Za-z' -]*$/,
37+
/^\p{L}[\p{L}' -]*$/u,
3838
"This field only accepts letters and ' - and must start with a letter"
3939
)
4040
.max(25, 'Your first name must be between 1 and 25 characters'),
4141
[ESU_FIELDS.LAST_NAME]: yup
4242
.string()
4343
.required('Please enter your last name')
4444
.matches(
45-
/^[A-Za-z][A-Za-z' -]*$/,
45+
/^\p{L}[\p{L}' -]*$/u,
4646
"This field only accepts letters and ' - and must start with a letter"
4747
)
4848
.max(50, 'Your last name must be between 1 and 50 characters'),

0 commit comments

Comments
 (0)