Build, test, and debug regular expressions
This regex validates LDAP Distinguished Name (DN) URLs, matching patterns with optional 'ldap://' protocol prefix followed by organizational units (OU) or common names (CN), and ending with 2-3 domain components (DC). It's useful for validating LDAP directory paths in authentication systems, Active Directory integrations, or directory service configurations. The pattern enforces character limits (1-63 chars per component) and accepts alphanumeric characters, hyphens, and underscores.