book: use compact table

Updates #227
This commit is contained in:
Changkun Ou
2022-07-17 12:51:14 +02:00
parent d740ee8b7c
commit b22404503e

View File

@@ -35,7 +35,7 @@ and lowercase letters, all numbers, all punctuation, and some other symbols.
A special character is a character with special meaning in a regular expression and is also the core matching syntax of a regular expression. See the table below:
| Symbol | Description |
| :----------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|:----------------:|:---|
| `$` | Matches the end position of the input string.|
| `(`,`)` | Marks the start and end of a subexpression. Subexpressions can be obtained for later use.|
| `*` | Matches the previous subexpression zero or more times. |
@@ -53,7 +53,7 @@ A special character is a character with special meaning in a regular expression
The qualifier is used to specify how many times a given component of a regular expression must appear to satisfy the match. See the table below:
| Symbol | Description |
| :-------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|:-------:|:-----|
| `*` | matches the previous subexpression zero or more times. For example, `foo*` matches `fo` and `foooo`. `*` is equivalent to `{0,}`.|
| `+` | matches the previous subexpression one or more times. For example, `foo+` matches `foo` and `foooo` but does not match `fo`. `+` is equivalent to `{1,}`.|
| `?` | matches the previous subexpression zero or one time. For example, `Your(s)?` can match `Your` in `Your` or `Yours`. `?` is equivalent to `{0,1}`.|