Skip to main content

RegistryUtils

internal function isSubdomainValid

Validates that a subdomain name is composed only from characters in the allowed character set:

  • the lowercase letters a-z
  • the digits 0-9
  • the hyphen -
function isSubdomainValid(string subDomain) internal pure returns (bool)
InputTypeDescription
subDomainstringThe name of the DAO.
Output
0booltrue if the name is valid or false if at least one char is invalid.

This function allows empty (zero-length) subdomains. If this should not be allowed, make sure to add a respective check when using this function in your code. Aborts on the first invalid char found.

© 2024