Skip to content

Commit 1f902e1

Browse files
Fix doc for String
1 parent 163fbac commit 1f902e1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

components/string.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,11 @@ Methods to Search and Replace
334334
u('foo')->equalsTo('foo'); // true
335335

336336
// checks if the string content match the given regular expression.
337-
// You can pass flags for preg_match() as second argument. If PREG_PATTERN_ORDER
338-
// or PREG_SET_ORDER are passed, preg_match_all() will be used.
339337
u('avatar-73647.png')->match('/avatar-(\d+)\.png/');
340-
// result = ['avatar-73647.png', '73647']
341-
u('avatar-73647.png')->match('/avatar-(\d+)(-\d+)?\.png/', \PREG_UNMATCHED_AS_NULL);
342338
// result = ['avatar-73647.png', '73647', null]
339+
340+
// You can pass flags for preg_match() as second argument. If PREG_PATTERN_ORDER
341+
// or PREG_SET_ORDER are passed, preg_match_all() will be used.
343342
u('206-555-0100 and 800-555-1212')->match('/\d{3}-\d{3}-\d{4}/', \PREG_PATTERN_ORDER);
344343
// result = [['206-555-0100', '800-555-1212']]
345344

0 commit comments

Comments
 (0)