| @@ 391-401 (lines=11) @@ | ||
| 388 | * |
|
| 389 | * @return bool |
|
| 390 | */ |
|
| 391 | public function match(string $regex, int $offset = 0): bool |
|
| 392 | { |
|
| 393 | $matches = []; |
|
| 394 | $value = preg_match($regex, $this->value, $matches, 0, $offset); |
|
| 395 | ||
| 396 | if ($value === false) { |
|
| 397 | throw new RegexException('', preg_last_error()); |
|
| 398 | } |
|
| 399 | ||
| 400 | return (bool) $value; |
|
| 401 | } |
|
| 402 | ||
| 403 | /** |
|
| 404 | * Return a collection of the elements matching the regex |
|
| @@ 357-367 (lines=11) @@ | ||
| 354 | * |
|
| 355 | * @return bool |
|
| 356 | */ |
|
| 357 | public function matches(string $regex, int $offset = 0): bool |
|
| 358 | { |
|
| 359 | $matches = []; |
|
| 360 | $value = preg_match($regex, $this->value, $matches, 0, $offset); |
|
| 361 | ||
| 362 | if ($value === false) { |
|
| 363 | throw new RegexException('', preg_last_error()); |
|
| 364 | } |
|
| 365 | ||
| 366 | return (bool) $value; |
|
| 367 | } |
|
| 368 | ||
| 369 | /** |
|
| 370 | * Return a collection of the elements matching the regex |
|