diff --git a/aimenet-web/lib/aime-card.ts b/aimenet-web/lib/aime-card.ts index 0e24ba6..9993aa3 100644 --- a/aimenet-web/lib/aime-card.ts +++ b/aimenet-web/lib/aime-card.ts @@ -1,3 +1,5 @@ +export const CARD_ID_REGEX = /^(?:[0-9]{4} ?){5}$/i; + /** * Generates a random Aime card id. */ @@ -16,5 +18,5 @@ export function generateAimeCardId(): string { * @param id The card id to validate */ export function validateAimeCardId(id: string): boolean { - return id[0] !== '3' && /^[0-9A-F]{20}$/i.test(id); + return id[0] !== '3' && CARD_ID_REGEX.test(id); } \ No newline at end of file