diff --git a/src/at/nsid.gleam b/src/at/nsid.gleam index 95a0c22..6631899 100644 --- a/src/at/nsid.gleam +++ b/src/at/nsid.gleam @@ -111,7 +111,8 @@ fn do_from_string( "" -> // The name segment must not start with a digit. case string.slice(input, slice_offset, slice_length) { - "1" <> _ + "0" <> _ + | "1" <> _ | "2" <> _ | "3" <> _ | "4" <> _ @@ -171,7 +172,7 @@ fn do_from_string( // An authority segment cannot start or end with a hyphen. "-." <> _ -> Error(Nil) - "-" if slice_length == 0 -> Error(Nil) + "-" <> _ if slice_length == 0 -> Error(Nil) // The first authority segment cannot start with a digit. "0" <> _