tags:

views:

18

answers:

1

Besides doing it manually using regular expression search, is there other better ways to parse a JAD file?

I need to be able to search for and replace/insert a new MIdlet-Install-Notify property to a JAD file given, also updating the value of the MIDlet-Jar-URL property.

Using ANTLR or TinyPG is a bit overkill for my case.

TIA

A: 

Even Regex might be overkill, although it certainly will get the job done. It is a very simple text format to parse, string.StartsWith() and string.IndexOf() to find the colon would work well.

Hans Passant
I ended up streamreading the jad into a dictionary, still a bit overkill but that offers me the uniqueness key checking, the downside is that when i change a value of a given key, I have to do the remove() followed by an add().Thanks anyway.
codemonkie