-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
File:
Form.php
Current:
'email' => '/^\w+([.-]?\w+)@\w+([.-]?\w+)(.\w{2,3})+$/',
AI analysis:
Key points:
- ^\w+ โ Local part must start with one or more โwordโ characters (letters, digits, underscore only โ no plus sign allowed here).
- ([.-]?\w+)* โ Allows optional dot or hyphen, followed by word characters, repeated any number of times.
- Domain part (@\w+([.-]?\w+)*) โ Same dot/hyphen rules as local part.
- (.\w{2,3})+ โ Topโlevel domain must be 2 or 3 โwordโ chars only (e.g., .com, .nz) โ cannot match .info or longer TLDs.
So loads of things that are not ideal with this regex.
Proposed:
'email' => '/^(?!.)(?!.*..)[A-Za-z0-9._%+-]+(?<!.)@(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-).)+[A-Za-z]{2,}$/',
Simple test:
Metadata
Metadata
Assignees
Labels
No labels