B
banansol
Hi,
I'm making a program that seraches a html file for special lines, and
I use the
Scanner class with a regex to find those lines. It is working well,
but now I wan't
to extract data that is on lines directly following my searched line.
If I could make big
regex that included several lines it would be no problem, but since
the method
findInLine() only searches one line at a time, I'm not sure how to do
it.
What is a good way to do this? I don't want a full blown html parser,
just a way to
find some 3-4 lines with same structure that are repeated several
times in a document.
As I said, if I could somehow could get a regex to span multiple
lines, that would be
good, I think. Another idea is to nest the searches, so that when I
find the first line
I could call a method or something that manually gets the remaing
lines and extract
the data from them, but that sounds more complicated. I'm not sure.
Any ideas?
Thanks!
I'm making a program that seraches a html file for special lines, and
I use the
Scanner class with a regex to find those lines. It is working well,
but now I wan't
to extract data that is on lines directly following my searched line.
If I could make big
regex that included several lines it would be no problem, but since
the method
findInLine() only searches one line at a time, I'm not sure how to do
it.
What is a good way to do this? I don't want a full blown html parser,
just a way to
find some 3-4 lines with same structure that are repeated several
times in a document.
As I said, if I could somehow could get a regex to span multiple
lines, that would be
good, I think. Another idea is to nest the searches, so that when I
find the first line
I could call a method or something that manually gets the remaing
lines and extract
the data from them, but that sounds more complicated. I'm not sure.
Any ideas?
Thanks!