Skip to content

Commit cd23500

Browse files
authored
Loosen NetID validation rules (#260)
UIUC can't follow their own NetID issuance rules, so lets just check for the first 4 rules in the NetID rules instead of all of them.
1 parent 532c13f commit cd23500

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/types/generic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export const illinoisNetId = z
1515
.string()
1616
.min(3, { message: "NetID must be at least 3 characters." })
1717
.max(8, { message: "NetID cannot be more than 8 characters." })
18-
.regex(/^[a-zA-Z]{2}[a-zA-Z-]*(?:[2-9]|[1-9][0-9]{1,2})?$/, {
19-
message: "NetID is not valid!",
18+
.regex(/^[a-z]{2}[a-z0-9-]{1,6}$/i, {
19+
message: "NetID is malformed.",
2020
})
2121
.meta({
2222
description: "Valid Illinois NetID. See https://answers.uillinois.edu/illinois/page.php?id=78766 for more information.",

0 commit comments

Comments
 (0)