Looking for an open source Java whois parser

4.3k Views Asked by At

I am trying to parse whois lookups in a java based whois server and looking to use a preexisting solution.

Please note: I am not looking to parse whois data or query any server.

I have looked into commons-cli and JavaCC the later is promising but the idea of generated code is not attractive. My ideal solution would be a parser able to load the grammar at runtime through a file.

Example inputs I would like to parse:

domain example.com
host id 3223
summary registrar id 2332

Thanks!

3

There are 3 best solutions below

2
On BEST ANSWER

After some more digging I got where I wanted to go. I found parboiled a scala/java parser generator using PEG.

Big thank you to Pangea and aldridmc, I will try to be more specific in the future.

5
On

There's no WHOIS parser written in Java. The only parsers currently available are written in PHP and Ruby.

I'm the author of the Ruby WHOIS library. An intelligent Ruby WHOIS client and parser.

The good news for you is that Ruby WHOIS is fully compatible with JRuby. It means you can use it in your Java environment as long as you use JRuby.

1
On

Apache Commons Net supports multiple protocols and whois one of them.