Skip to content

Commit 0251131

Browse files
weakishcristianoc
authored andcommitted
markdown formatting for api/js/string[2]
1 parent 264a558 commit 0251131

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pages/docs/manual/latest/api/js/string-2.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ let match_: (t, Js_re.t) => option<array<option<t>>>
321321
`match(regexp, str)` matches a `string` against the given `regexp`. If there is no match, it returns `None`. For regular expressions without the g modifier, if there is a match, the return value is `Some(array)` where the array contains:
322322
- The entire matched string
323323
- Any capture groups if the regexp had parentheses
324+
324325
For regular expressions with the g modifier, a matched expression returns `Some(array)` with all the matched substrings and no capture groups. Javscript String.prototype.match can return `undefined` for optional capture groups that are not found, thus the element of the returned array is typed `option<t>`. See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.
325326

326327
```res example

pages/docs/manual/latest/api/js/string.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ let match_: (Js_re.t, t) => option<array<option<t>>>
321321
`match(regexp, str)` matches a `string` against the given `regexp`. If there is no match, it returns `None`. For regular expressions without the g modifier, if there is a match, the return value is `Some(array)` where the array contains:
322322
- The entire matched string
323323
- Any capture groups if the regexp had parentheses
324+
324325
For regular expressions with the g modifier, a matched expression returns `Some(array)` with all the matched substrings and no capture groups. Javscript String.prototype.match can return `undefined` for optional capture groups that are not found, thus the element of the returned array is typed `option<t>`. See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.
325326

326327
```res example

0 commit comments

Comments
 (0)