Q:

ANTLR suitable for parsing text reports?

I am currently using regular expressions to parse a text report in order to extract various bits of information. While this approach works, it becomes increasingly difficult to maintain the regex. I am wondering if Antlr can provide a better way to accomplish the task in the long run. BTW, I haven't used Antlr before.
AFAIK, Antlr is mostly used for parsing languages, but my report is not a language. On the other hand, the report follows some patterns and that's how I am able to use regex to extract information.
More about my text report: The report has several sections, and I am only interested in some of the sections while ignoring the rest. For example, there is a thread dump section:
===Start===
(some text I do not care about.)
thread <thread-number> <owning-proc-name> <proc-id>
<resource-owned-by-thread> (optional line)
...
===End===

And then there is a terminated app section:
===Start===
(some text I do not care about, followed by the stack trace of the app)
<app-name>
<stack-layer1>
<stack-layer2>
...
===End===

What I hope to get out of by parsing the report is a data object with getter methods to various piece of data in the report.
Is it suitable task for Antlr or should I look elsewhere? Thank you very much!

A:

Can you easily filter out the text you don't want using a regex? If so, you could take a hybrid approach that would be pretty effective:

Run the report through the regex filter to remove the text to ignore
Run the report through an ANTLR parser to break apart the parts you care about

For this to work, the parts you care about would have to conform to a language you can write an ANTLR grammar for.
Another alternative would be to write a custom scanner that strips out the parts to ignore and tokenizes the rest.
It all really depends on the complexity and regularity of the parts you need to retain.  

