Completed
Push — master ( 913334...a0866d )
by Jean-Christophe
02:09
created

EmailValidator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Ubiquity\contents\validation\validators\strings;
4
5
/**
6
 * Validates an email address
7
 * Usage @validator("email")
8
 * @author jc
9
 * @version 1.0.0
10
 */
11
class EmailValidator extends RegexValidator {
12
	
13
	public function __construct(){
14
		$this->message="{value is not a valid email address}";
15
		$this->ref="/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/i";
16
		$this->match=true;
17
	}
18
}
19
20