From 84463359c084250a2464f3d39dd7b403a87f2e8a Mon Sep 17 00:00:00 2001 From: Gavin McGimpsey Date: Sun, 22 Oct 2023 23:44:23 -0700 Subject: [PATCH] Clarify language and fix typo in Regular Expression concept docs (#378) --- concepts/regular-expressions/about.md | 4 ++-- concepts/regular-expressions/introduction.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/concepts/regular-expressions/about.md b/concepts/regular-expressions/about.md index 269c465f8..c9185d378 100644 --- a/concepts/regular-expressions/about.md +++ b/concepts/regular-expressions/about.md @@ -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. @@ -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+)") diff --git a/concepts/regular-expressions/introduction.md b/concepts/regular-expressions/introduction.md index d2de2272e..cdcf9e2e4 100644 --- a/concepts/regular-expressions/introduction.md +++ b/concepts/regular-expressions/introduction.md @@ -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. @@ -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+)")