Skip to content

Commit 1d258b0

Browse files
committed
Expand docs
1 parent e1ee097 commit 1d258b0

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
@@ -91,6 +91,11 @@ if (Preg::matchStrictGroups('{fo+}', $string, $matches))
9191
if (Preg::matchAllStrictGroups('{fo+}', $string, $matches))
9292
```
9393

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

96101
```php

0 commit comments

Comments
 (0)