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!