1

I am trying to think of a good method for locating the expiration date of a domain within a who-is record systematically. Here is my current idea:

  • Locate "Expir" in the string of who-is information (this works with "Expiration," "Expiry," and anything else).
  • Locate the first occurrence of a number on the same line.
  • Scan it Day-Month-Year from the string, separating them by the dashes.

The only problem I can find with this method is that the expiration date may be in any order. There is also the possibility that something without "Expir" in it at all may be used for the expiration date of a domain.

Thoughts, fellow programmers? Thanks!

1 Answers1

1

The approach you are following is not accurate. There is no standard, every registry can returns a completely different string for the expiration date. In some cases, it doesn't even match Expir (for example some whois responses contains Until).

If you want to be as accurate as possible, you need to create one rule for every single TLD.

This is the approach I followed for the Ruby WHOIS library. In this case I went one step further by writing one full parser for every TLD.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364