I have this regular expression:
/^www\\.example\\.(com|co(\\.(in|uk))?|net|us|me)\\/?(.*)?[^\\/]$/g
It matches:
www.example.com/ex