I am struggling with a JavaScript regular expression error that Safari is giving me. I am trying to validate a domain, but for some reason, this specific part (?<!-)
is causing the issue because the domain name should not end with a hyphen.
^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,63}$
I believe the problem lies in Safari's lack of support for negative lookbehind, which is what's causing this specific error. I would really appreciate some assistance in solving this problem.