I want to parse a .java or .txt file and store the contents in some data structure, say an array or linked list. using java.util.regex is the correct option or is there any other better option to do the same? the contents generated out of this parsing would be huge.
thanks in advance!:)
I don't see why you wouldn't use regular expressions. They are great for parsing anything and i don't see this case being any different.
May be she is looking to store line by line on an array of a file. I'm not clear that.
As far as data structures go, i would think that the linked list would be your best bet if you are just grabbing pieces and putting them into the structure from a file on indefinite length, but if you are parsing different parts out of it then you might need a custom structure for all of your parts. Would need more specifics on the problem.
Yep I agreed with you. In such a cases arrays are not sufficient. I just use the word for outlining his requirement.