diff --git a/src/Extracting/ParsesValidationRules.php b/src/Extracting/ParsesValidationRules.php index 148ed3ea..827d56e5 100644 --- a/src/Extracting/ParsesValidationRules.php +++ b/src/Extracting/ParsesValidationRules.php @@ -809,7 +809,7 @@ private function examplePresent(array $parameterData) protected function getDescription(string $rule, array $arguments = [], $baseType = 'string'): string { if ($rule == 'regex') { - return "Must match the regex {$arguments[':regex']}."; + return "Must match the regex {$arguments[':regex']}."; } $translationString = "validation.{$rule}"; diff --git a/tests/Unit/ValidationRuleParsingTest.php b/tests/Unit/ValidationRuleParsingTest.php index 1d6d142b..a7574cf1 100644 --- a/tests/Unit/ValidationRuleParsingTest.php +++ b/tests/Unit/ValidationRuleParsingTest.php @@ -440,7 +440,12 @@ public static function supportedRules() yield 'regex' => [ ['regex_param' => 'regex:/\d/'], [], - ['description' => 'Must match the regex /\d/.'], + ['description' => 'Must match the regex /\d/.'], + ]; + yield 'regex with pipe and special chars' => [ + ['document' => 'regex:/^\d{11}|\d{14}$/'], + [], + ['description' => 'Must match the regex /^\d{11}|\d{14}$/.'], ]; yield 'accepted' => [ ['accepted_param' => 'accepted'],