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

Clarify language and fix typo in Regular Expression concept docs #378

Merged
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/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The most common way to create regular expressions is using the `regex.from_strin
let assert Ok(re) = regex.from_string("test")
```

The regular expression creation functions an error if the regular expression syntax is invalid, so a let-assertion has been used here to ensure the regular expression is valid.
The `regex.from_string` function yields an `Error` if the regular expression syntax is invalid, so a let-assertion has been used here to ensure the regular expression is valid.

The `regex.check` function can be used to check if a regular expression matches a string.

Expand All @@ -33,7 +33,7 @@ regex.check(re, "this is too")

## Captures

If you wish to capture substrings using a regular expression the `regex.scan` function can be used to return a list of matches.
If you wish to capture substrings using a regular expression, the `regex.scan` function can be used to return a list of matches.

```gleam
let assert Ok(re) = regex.from_string("[oi]n a (\\w+)")
Expand Down
4 changes: 2 additions & 2 deletions concepts/regular-expressions/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The most common way to create regular expressions is using the `regex.from_strin
let assert Ok(re) = regex.from_string("test")
```

The regular expression creation functions an error if the regular expression syntax is invalid, so a let-assertion has been used here to ensure the regular expression is valid.
The `regex.from_string` function yields an `Error` if the regular expression syntax is invalid, so a let-assertion has been used here to ensure the regular expression is valid.

The `regex.check` function can be used to check if a regular expression matches a string.

Expand All @@ -33,7 +33,7 @@ regex.check(re, "this is too")

## Captures

If you wish to capture substrings using a regular expression the `regex.scan` function can be used to return a list of matches.
If you wish to capture substrings using a regular expression, the `regex.scan` function can be used to return a list of matches.

```gleam
let assert Ok(re) = regex.from_string("[oi]n a (\\w+)")
Expand Down