Your approach seems to fail for .de in one case and .name, .mobi, .museum in the other case. The only approach is to use a list of known TLDs.
In reply to Re^2: Heuristic for parsing Host name and domain
by Corion
in thread Heuristic for parsing Host name and domain
by persistence911
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |