From 2ca99e9de77f38830f0b867bafaa9d1004b28acc Mon Sep 17 00:00:00 2001 From: Guy Gastineau Date: Mon, 27 Jun 2022 16:58:34 -0400 Subject: [PATCH] Fix error in 'Advanced examples' expression The section on character groups clearly states "To include a literal -, make it the first or last character, ..." In the example `Block domains without subdomains` the bounded character group `[\-]{1}` should be `[-]{1}` if the intention is to match a literal `-` as suggested by the accompanying description. Signed-off-by: Guy Gastineau --- docs/regex/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/regex/tutorial.md b/docs/regex/tutorial.md index 0ca66e9..c478b1b 100644 --- a/docs/regex/tutorial.md +++ b/docs/regex/tutorial.md @@ -119,7 +119,7 @@ Blocks domains containing only numbers (no letters) and ending in `.com` or `.ed ### Block domains without subdomains ``` -^[a-z0-9]+([\-]{1}[a-z0-9]+)*\.[a-z]{2,7}$ +^[a-z0-9]+([-]{1}[a-z0-9]+)*\.[a-z]{2,7}$ ``` A domain name shall not start or end with a dash but can contain any number of them. It must be followed by a TLD (we assume a valid TLD length of two to seven characters)