Skip to content
Snippets Groups Projects
Commit 835bf845 authored by Thomas Flori's avatar Thomas Flori
Browse files

fix local part and domain part patterns of email address validation

parent 6d7850a4
No related branches found
No related tags found
1 merge request!23allow upper case letters in domain part of emails and fix local part …
Pipeline #749 passed with stages
in 5 minutes and 49 seconds
......@@ -7,8 +7,8 @@ use Verja\Validator;
class EmailAddress extends Validator
{
const LOCAL_PART_PATTERN = '[A-Za-z0-9.!#$%&\'*+\/=?^_`{|}~.]+-';
const DOMAIN_PART_PATTERN = '(?:[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)(?:\.[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)+';
const LOCAL_PART_PATTERN = '[A-Za-z0-9.!#$%&\'*+\/=?^_`{|}~.-]+';
const DOMAIN_PART_PATTERN = '[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:\.[a-zA-Z0-9]{2,}(?:-[a-zA-Z0-9]+)*)+';
/** {@inheritdoc} */
public function validate($value, array $context = []): bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment