Skip to content

Commit d740ee8

Browse files
committed
book: reword for latex style fixes
Fixes changkun#227
1 parent 0616cb8 commit d740ee8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

book/en-us/06-regex.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ and lowercase letters, all numbers, all punctuation, and some other symbols.
3434

3535
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:
3636

37-
| Special characters | Description |
37+
| Symbol | Description |
3838
| :----------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3939
| `$` | Matches the end position of the input string. |
4040
| `(`,`)` | Marks the start and end of a subexpression. Subexpressions can be obtained for later use. |
@@ -52,7 +52,7 @@ A special character is a character with special meaning in a regular expression
5252

5353
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:
5454

55-
| Character | Description |
55+
| Symbol | Description |
5656
| :-------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5757
| `*` | matches the previous subexpression zero or more times. For example, `foo*` matches `fo` and `foooo`. `*` is equivalent to `{0,}`. |
5858
| `+` | matches the previous subexpression one or more times. For example, `foo+` matches `foo` and `foooo` but does not match `fo`. `+` is equivalent to `{1,}`. |
@@ -84,7 +84,7 @@ We use a simple example to briefly introduce the use of this library. Consider t
8484

8585
int main() {
8686
std::string fnames[] = {"foo.txt", "bar.txt", "test", "a0.txt", "AAA.txt"};
87-
// In C++, `\` will be used as an escape character in the string. In order for `\.`
87+
// In C++, `\` will be used as an escape character in the string. In order for `\.`
8888
// to be passed as a regular expression, it is necessary to perform second escaping of `\`, thus we have `\\.`
8989
std::regex txt_regex("[a-z]+\\.txt");
9090
for (const auto &fname: fnames)
@@ -187,18 +187,18 @@ Please implement the member functions `start()` and `parse_request`. Enable serv
187187
template<typename SERVER_TYPE>
188188
void start_server(SERVER_TYPE &server) {
189189
190-
// process GET request for /match/[digit+numbers], e.g.
190+
// process GET request for /match/[digit+numbers], e.g.
191191
// GET request is /match/abc123, will return abc123
192192
server.resource["fill_your_reg_ex"]["GET"] = [](ostream& response, Request& request) {
193193
string number=request.path_match[1];
194-
response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length()
194+
response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length()
195195
<< "\r\n\r\n" << number;
196196
};
197197
198198
// peocess default GET request; anonymous function will be called if no other matches
199199
// response files in folder web/
200200
// default: index.html
201-
server.default_resource["fill_your_reg_ex"]["GET"] =
201+
server.default_resource["fill_your_reg_ex"]["GET"] =
202202
[](ostream& response, Request& request) {
203203
string filename = "www/";
204204

0 commit comments

Comments
 (0)