Skip to content

Commit 0a53159

Browse files
authored
Add missing Str::isMatch() documentation. (#10955)
1 parent 8af3c88 commit 0a53159

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

strings.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
7272
[Str::mask](#method-str-mask)
7373
[Str::match](#method-str-match)
7474
[Str::matchAll](#method-str-match-all)
75+
[Str::isMatch](#method-str-is-match)
7576
[Str::orderedUuid](#method-str-ordered-uuid)
7677
[Str::padBoth](#method-str-padboth)
7778
[Str::padLeft](#method-str-padleft)
@@ -1084,6 +1085,23 @@ $result = Str::matchAll('/f(\w*)/', 'bar fun bar fly');
10841085

10851086
If no matches are found, an empty collection will be returned.
10861087

1088+
<a name="method-str-is-match"></a>
1089+
#### `Str::isMatch()` {.collection-method}
1090+
1091+
The `Str::isMatch` method will return `true` if the string matches a given regular expression:
1092+
1093+
```php
1094+
use Illuminate\Support\Str;
1095+
1096+
$result = Str::isMatch('/foo (.*)/', 'foo bar');
1097+
1098+
// true
1099+
1100+
$result = Str::isMatch('/foo (.*)/', 'laravel');
1101+
1102+
// false
1103+
```
1104+
10871105
<a name="method-str-ordered-uuid"></a>
10881106
#### `Str::orderedUuid()` {.collection-method}
10891107

0 commit comments

Comments
 (0)