Skip to content

Commit

Permalink
Clarify language and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmcgimpsey authored Oct 22, 2023
1 parent 368b54b commit 437962a
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 437962a

Please sign in to comment.