-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added email regex * Improved the regex to allow longer tld * Updated failing test case to account for new core regex class. --------- Co-authored-by: Yorda <yordadevs@gmail.com>
- Loading branch information
1 parent
7992560
commit c3e8f76
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace YorCreative\Scrubber\RegexCollection; | ||
|
||
use YorCreative\Scrubber\Interfaces\RegexCollectionInterface; | ||
|
||
class EmailAddress implements RegexCollectionInterface | ||
{ | ||
public function getPattern(): string | ||
{ | ||
return '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}'; | ||
} | ||
|
||
public function getTestableString(): string | ||
{ | ||
return 'johndoe321@example.associates'; | ||
} | ||
|
||
public function isSecret(): bool | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters