Skip to content

Commit

Permalink
Added alphanumeric_dotted_names validator
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleangioni committed Nov 3, 2015
1 parent d81d208 commit 9c996c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ Just after registering the SupportServiceProvider, the following new custom vali
- alpha_underscore : The following characters are allowed: letters, numbers and underscores
- alpha_names : The following characters are allowed: letters, menus, apostrophes, underscores and spaces
- alphanumeric_names : The following characters are allowed: letters, numbers, menus, apostrophes, underscores and spaces
- alphanumeric_dotted_names : The following characters are allowed: letters, numbers, menus, apostrophes, underscores, dots and spaces

## Custom Exceptions

Expand Down
12 changes: 12 additions & 0 deletions src/MicheleAngioni/Support/CustomValidators.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ public function validateAlphanumericNames($attribute, $value)
return preg_match('/^([-\p{L}0-9\'_\s])+$/u', $value);
}

/**
* alphanumeric_dotted_names permits the following UNICODE characters: letters, numbers, menus, apostrophes, underscores, dots and spaces
*
* @param $attribute
* @param $value
* @return int
*/
public function validateAlphanumericDottedNames($attribute, $value)
{
return preg_match('/^([-\p{L}0-9.\'_\s])+$/u', $value);
}

/**
* alpha_names permits the following UNICODE characters: letters, menus, apostrophes, underscores and spaces
*
Expand Down

0 comments on commit 9c996c2

Please sign in to comment.