Test, validate and match regular expressions
This regular expression validates a domain name by enforcing specific rules for the second-level domain (SLD) and the top-level domain (TLD). The SLD can be 1-2 characters (letters and numbers) or 3-63 characters where it starts and ends with an alphanumeric character, allowing hyphens and underscores in the middle. It supports standard TLDs of 2-6 letters (like .com, .org) as well as compound TLDs like .co.uk. This regex is ideal for validating website domains in user registration or input forms.