From a71c9dee50adc023e3ea51f1e4ae4e76f530ce5d Mon Sep 17 00:00:00 2001 From: Matthew Davis Date: Thu, 18 Dec 2025 22:12:24 +0000 Subject: [PATCH] Add missing Str::isMatch() documentation. --- strings.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/strings.md b/strings.md index c5d425f6e4..ce8797bf68 100644 --- a/strings.md +++ b/strings.md @@ -72,6 +72,7 @@ Laravel includes a variety of functions for manipulating string values. Many of [Str::mask](#method-str-mask) [Str::match](#method-str-match) [Str::matchAll](#method-str-match-all) +[Str::isMatch](#method-str-is-match) [Str::orderedUuid](#method-str-ordered-uuid) [Str::padBoth](#method-str-padboth) [Str::padLeft](#method-str-padleft) @@ -1084,6 +1085,23 @@ $result = Str::matchAll('/f(\w*)/', 'bar fun bar fly'); If no matches are found, an empty collection will be returned. + +#### `Str::isMatch()` {.collection-method} + +The `Str::isMatch` method will return `true` if the string matches a given regular expression: + +```php +use Illuminate\Support\Str; + +$result = Str::isMatch('/foo (.*)/', 'foo bar'); + +// true + +$result = Str::isMatch('/foo (.*)/', 'laravel'); + +// false +``` + #### `Str::orderedUuid()` {.collection-method}