Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in regular-expressions concept instructions #2797

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions concepts/regular-expressions/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ because it means we don't need to escape backslashes:
To use a regular expression, we first must compile the string pattern.
Compilation here means taking the string pattern of the regular expression and converting it into an internal representation that is easier to work with.
We only need to compile each pattern once, after that we can use the compiled version of the regular expression many times.
The type `regexp.Regexp` represents a compiled regular expressions.
The type `regexp.Regexp` represents a compiled regular expression.
We can compile a string pattern into a `regexp.Regexp` using the function `regexp.Compile`.
This function returns `nil` and an error if compilation failed:

Expand Down Expand Up @@ -60,7 +60,7 @@ Their names are matched by this regular expression:
Find(All)?(String)?(Submatch)?(Index)?
```

* If `All` is present, the routine matches successive non-overlapping matches of the entire expressions.
* If `All` is present, the routine matches successive non-overlapping matches of the entire expression.
* If `String` is present, the argument is a string; otherwise it is a slice of bytes; return values are adjusted as appropriate.
* If `Submatch` is present, the return value is a slice identifying the successive submatches of the expression.
* If `Index` is present, matches and submatches are identified by byte index pairs within the input string.
Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/parsing-log-files/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ because it means we don't need to escape backslashes:
To use a regular expression, we first must compile the string pattern.
Compilation here means taking the string pattern of the regular expression and converting it into an internal representation that is easier to work with.
We only need to compile each pattern once, after that we can use the compiled version of the regular expression many times.
The type `regexp.Regexp` represents a compiled regular expressions.
The type `regexp.Regexp` represents a compiled regular expression.
We can compile a string pattern into a `regexp.Regexp` using the function `regexp.Compile`.
This function returns `nil` and an error if compilation failed:

Expand Down Expand Up @@ -60,7 +60,7 @@ Their names are matched by this regular expression:
Find(All)?(String)?(Submatch)?(Index)?
```

* If `All` is present, the routine matches successive non-overlapping matches of the entire expressions.
* If `All` is present, the routine matches successive non-overlapping matches of the entire expression.
* If `String` is present, the argument is a string; otherwise it is a slice of bytes; return values are adjusted as appropriate.
* If `Submatch` is present, the return value is a slice identifying the successive submatches of the expression.
* If `Index` is present, matches and submatches are identified by byte index pairs within the input string.
Expand Down
Loading