diff --git a/deno/lib/__tests__/string.test.ts b/deno/lib/__tests__/string.test.ts index ac72d42cd..78a4458ef 100644 --- a/deno/lib/__tests__/string.test.ts +++ b/deno/lib/__tests__/string.test.ts @@ -276,7 +276,6 @@ test("cuid2", () => { validStrings.forEach((s) => cuid2.parse(s)); const invalidStrings = [ "", // empty string - "1z4a98xxat96iws9zmbrgj3a", // starts with a number "tz4a98xxat96iws9zMbrgj3a", // include uppercase "tz4a98xxat96iws-zmbrgj3a", // involve symbols ]; diff --git a/src/__tests__/string.test.ts b/src/__tests__/string.test.ts index 915532272..2eae674b1 100644 --- a/src/__tests__/string.test.ts +++ b/src/__tests__/string.test.ts @@ -275,7 +275,6 @@ test("cuid2", () => { validStrings.forEach((s) => cuid2.parse(s)); const invalidStrings = [ "", // empty string - "1z4a98xxat96iws9zmbrgj3a", // starts with a number "tz4a98xxat96iws9zMbrgj3a", // include uppercase "tz4a98xxat96iws-zmbrgj3a", // involve symbols ]; diff --git a/src/types.ts b/src/types.ts index d7f92f479..d0c5bb204 100644 --- a/src/types.ts +++ b/src/types.ts @@ -572,7 +572,7 @@ export interface ZodStringDef extends ZodTypeDef { } const cuidRegex = /^c[^\s-]{8,}$/i; -const cuid2Regex = /^[a-z][a-z0-9]*$/; +const cuid2Regex = /^[0-9a-z]+$/; const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; // const uuidRegex = // /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;