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 <strings.stringsandstrings@gmail.com>
This commit is contained in:
Guy Gastineau
2022-06-27 16:58:34 -04:00
parent 406c374766
commit 2ca99e9de7
+1 -1
View File
@@ -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)