Skip to content

Commit a1f708c

Browse files
committed
docs: tweaks
1 parent 611555a commit a1f708c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Terminology:
7070
Most of the regex constructs accept a regex sequence as their argument.
7171

7272
Examples of sequences:
73+
- single element (construct): `capture('abc')`
74+
- single element (string): `'Hello'`
7375
- array of elements: `['USD', oneOrMore(digit)]`
74-
- single construct: `capture('abc')`
75-
- single string: `'Hello'`
7676

7777
Regex constructs can be composed into a tree structure:
7878

@@ -94,21 +94,21 @@ Comprehensive API document is available [here](./API.md).
9494

9595
### Regex Builders
9696

97-
| Builder | Regex Pattern | Description |
97+
| Builder | Regex Syntax | Description |
9898
| ---------------------------------------- | ------------- | ----------------------------------- |
9999
| `buildRegExp(...)` | `/.../` | Create `RegExp` instance |
100100
| `buildRegExp(..., { ignoreCase: true })` | `/.../i` | Create `RegExp` instance with flags |
101101

102102
### Regex Constructs
103103

104-
| Regex Construct | Regex Pattern | Notes |
104+
| Construct | Regex Syntax | Notes |
105105
| ------------------- | ------------- | ------------------------------- |
106106
| `capture(...)` | `(...)` | Create a capture group |
107107
| `choiceOf(x, y, z)` | `x\|y\|z` | Match one of provided sequences |
108108

109109
### Quantifiers
110110

111-
| Regex Construct | Regex Pattern | Description |
111+
| Quantifier | Regex Syntax | Description |
112112
| -------------------------------- | ------------- | ------------------------------------------------- |
113113
| `zeroOrMore(x)` | `x*` | Zero or more occurence of a pattern |
114114
| `oneOrMore(x)` | `x+` | One or more occurence of a pattern |
@@ -119,7 +119,7 @@ Comprehensive API document is available [here](./API.md).
119119

120120
### Character classes
121121

122-
| Regex Construct | Regex Pattern | Description |
122+
| Character class | Regex Syntax | Description |
123123
| --------------------- | ------------- | ------------------------------------------- |
124124
| `any` | `.` | Any character |
125125
| `word` | `\w` | Word characters |
@@ -132,7 +132,7 @@ Comprehensive API document is available [here](./API.md).
132132

133133
### Anchors
134134

135-
| Regex Construct | Regex Pattern | Description |
135+
| Anchor | Regex Syntax | Description |
136136
| --------------- | ------------- | ---------------------------------------------------------------- |
137137
| `startOfString` | `^` | Match start of the string (or start of a line in multiline mode) |
138138
| `endOfString` | `$` | Match end of the string (or end of a line in multiline mode) |

docs/API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ function repeat(
121121
): Repeat
122122
```
123123

124-
Regex syntax: `{n}`, `{min,}`, `{min, max}`.
124+
Regex syntax: `x{n}`, `x{min,}`, `x{min, max}`.
125125

126-
The `repeat` quantifier in regex matches either exactly `count` or between `min` and `max` count. If only `min` is provided it matches at least `min` count.
126+
The `repeat` quantifier in regex matches either exactly `count` times or between `min` and `max` times. If only `min` is provided it matches at least `min` times.
127127

128128
## Character classes
129129

0 commit comments

Comments
 (0)