| 1 | <?php |
||
| 7 | class RegexFailed extends Exception |
||
| 8 | { |
||
| 9 | public static function match(string $pattern, string $subject, string $message): self |
||
| 15 | |||
| 16 | public static function replace(string $pattern, string $subject, string $message): self |
||
| 22 | |||
| 23 | public static function indexedGroupDoesntExist(string $pattern, string $subject, int $index): self |
||
| 24 | { |
||
| 25 | return new static("Pattern `{$pattern}` with subject `{$subject}` didn't capture a group at index {$index}"); |
||
| 26 | } |
||
| 27 | |||
| 28 | public static function namedGroupDoesntExist(string $pattern, string $subject, string $groupName): self |
||
| 32 | |||
| 33 | protected static function trimString(string $string): string |
||
| 41 | } |
||
| 42 |