You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API.md
+58-7Lines changed: 58 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,20 @@ It optionally accepts a list of regex flags:
46
46
47
47
These functions and objects represent available regex constructs.
48
48
49
+
### `choiceOf()`
50
+
51
+
```ts
52
+
function choiceOf(
53
+
...alternatives:RegexSequence[]
54
+
):ChoiceOf {
55
+
```
56
+
57
+
Regex syntax: `a|b|c`.
58
+
59
+
The `choiceOf` (disjunction) construct matches one out of several possible sequences. It functions similarly to a logical OR operator in programming. It can match simple string options as well as complex patterns.
60
+
61
+
Example: `choiceOf("color", "colour")` matches either `color` or `colour` pattern.
0 commit comments