Skip to content

Commit 056f26b

Browse files
committed
Expand docs
1 parent 317c8a5 commit 056f26b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ if (Preg::matchStrictGroups('{fo+}', $string, $matches))
9595
if (Preg::matchAllStrictGroups('{fo+}', $string, $matches))
9696
```
9797

98+
**Note:** This is generally safe to use as long as you do not have optional subpatterns (i.e. `(something)?`).
99+
A subpattern that can match an empty string like `(.*)` is **not** optional, it will be present as an
100+
empty string in the matches. A non-matching subpattern, even if optional like `(?:foo)?` will anyway not be present in
101+
matches so it is also not a problem to use these with `*StrictGroups` methods.
102+
98103
If you would prefer a slightly more verbose usage, replacing by-ref arguments by result objects, you can use the `Regex` class:
99104

100105
```php

0 commit comments

Comments
 (0)