Based on what you have said, you can use:
^([a-zA-Z0-9][-a-zA-Z0-9]*[a-zA-Z0-9]\.)([a-zA-Z0-9]{3,5})$
Perhaps if you tell us what you are really trying to do (i.e the problem you are trying to solve and not the solutions that you have tried), then we can give you a better pattern.
For example, the pattern above assumes that the text you are matching is the only link in the text (or each line of the text if the "multiline" option is set). If you are after matching 2 strings of characters with a single period character 3 to 5 characters from the end, then another options is:
^\w+\.\w{3,5}\r?$
if you only want to match alphanumerics (the '\w' parts) but this will not include some characters that are legal in a URL (in fact URL's are notoriously hard to match with regexes if you really want to cover everything that is allowed).
Susan