We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46503bf commit 9329710Copy full SHA for 9329710
src/ParsingInput.php
@@ -135,8 +135,8 @@ public function consumeString(string $value): void
135
*/
136
public function consumeRegex(string $pattern): string
137
{
138
- assert(str_starts_with($pattern, '/^'));
139
- assert(!preg_match('/\$\/[a-z]+$/i', $pattern));
+ assert(str_starts_with($pattern, '/^'), "Regular expression must be anchored to beginning of string");
+ assert(!preg_match('/\$\/[a-z]+$/i', $pattern), "Regular expression must not be anchored to end of string");
140
141
if (preg_match($pattern, $this->remaining(), $matches)) {
142
$this->position += strlen($matches[0]);
0 commit comments