Skip to content

Commit

Permalink
Fix typos in regular-expressions concept instructions (#2797)
Browse files Browse the repository at this point in the history
* Update introduction.md - fix typo

Change "... represents a compiled regular expressions." to "... represents a compiled regular expression."

* Update introduction.md - another typo

Change "of the entire expressions." to "of the entire expression."

* Update concepts/regular-expressions/introduction.md too

Previous commits updated exercises/concept/parsing-log-files/.docs/introduction.md which was specific to that exercise. This commit updates the concept file as well.
  • Loading branch information
toryc authored Jul 16, 2024
1 parent 788fec9 commit 9fbb9c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 9fbb9c3

Please sign in to comment.