diff --git a/README.md b/README.md index e87be04..a3d5a20 100644 --- a/README.md +++ b/README.md @@ -541,7 +541,7 @@ min and max allowed values can be inserted. Just after registering the SupportServiceProvider, the following new custom validators will be available: -- alpha_complete : The following characters are allowed: letters, numbers, spaces, slashes and several punctuation characters _ ! . , : / ; ? & ( ) [ ] { } +- alpha_complete : The following characters are allowed: letters, numbers, spaces, slashes, pipes and several punctuation characters | = # _ ! . , : / ; ? & ( ) [ ] { } - alpha_space : The following characters are allowed: letters, numbers and spaces - alpha_underscore : The following characters are allowed: letters, numbers and underscores - alpha_names : The following characters are allowed: letters, menus, apostrophes, underscores and spaces diff --git a/src/MicheleAngioni/Support/CustomValidators.php b/src/MicheleAngioni/Support/CustomValidators.php index f379843..6812005 100644 --- a/src/MicheleAngioni/Support/CustomValidators.php +++ b/src/MicheleAngioni/Support/CustomValidators.php @@ -4,7 +4,7 @@ class CustomValidators extends \Illuminate\Validation\Validator { /** - * alpha_complete permits the following UNICODE characters: alphabetic, numbers, spaces, slashes, ed some punctuation characters + * alpha_complete permits the following UNICODE characters: alphabetic, numbers, spaces, slashes, pipes ed some punctuation characters * N.B. In order to add the '?' the \\ must be used * N.B. The final u is a modifier, see http://php.net/manual/en/reference.pcre.pattern.modifiers.php * @@ -15,7 +15,7 @@ class CustomValidators extends \Illuminate\Validation\Validator */ public function validateAlphaComplete($attribute, $value) { - return preg_match('/^([-\p{L}*0-9_+!.,:\/;\\?&\(\)\[\]\{\}\'\"\s])+$/u', $value); + return preg_match('/^([|=#-\p{L}*0-9_+!.,:\/;\\?&\(\)\[\]\{\}\'\"\s])+$/u', $value); } /**