Using parboiled for parsing WHOIS records

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using parboiled for parsing WHOIS records

KidCrippler
Hello,

I have a general question regarding some of parboiled's capabilities.
I need to parse WHOIS records that come as a big raw data chunk into very specific fields.
There are many unique formats for the raw data, and therefore no general solution would apply.
Writing a regex for each whois server could be a way to tackle the problem, but I don't know if regexes are flexible enough to handle this kind of problem.

I posted a detailed question containing more examples in Stackoverflow:
http://stackoverflow.com/questions/28653098/automatic-whois-data-parsing/

I looked through the parboiled documentation and it seems like there's quite a steep learning curve involved in using it.
Do you think I'd rather use the parboiled approach or revert back to regexes?

Thanks in advance,
Alon
fge
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using parboiled for parsing WHOIS records

fge
Alon Cohen wrote
Hello,

I have a general question regarding some of parboiled's capabilities.
I need to parse WHOIS records that come as a big raw data chunk into very specific fields.
There are many unique formats for the raw data, and therefore no general solution would apply.
Writing a regex for each whois server could be a way to tackle the problem, but I don't know if regexes are flexible enough to handle this kind of problem.

I posted a detailed question containing more examples in Stackoverflow:
http://stackoverflow.com/questions/28653098/automatic-whois-data-parsing/

I looked through the parboiled documentation and it seems like there's quite a steep learning curve involved in using it.
Do you think I'd rather use the parboiled approach or revert back to regexes?

Thanks in advance,
Alon
Parboiled (or grappa, which is a fork that I maintain given that parboiled is now unmaintained) is not that hard.

You can see a full example of a grammar using grappa for parsing JSON here. Also, grappa provides a debugger which right now only has the capability to analyze trace files; for grappa 1.0.x you want to use the tracer backport.

I have yet to document but please consider using it! It is perfectly suited for this job. Mechanisms also exist to collect match data and actually build POJOs out of parsing data. See the README of the grappa project for more information.
Loading...