in reply to complex string matching
The way I see it, you don't have a complex string-matching problem. The configuration file is effectively (key,value) pairs with syntatic sugar wrapped around them to make them into valid javascript. What you have is a hash-lookup problem.
The way I would approach it is to read in your new configuration (key,value) pairs from wherever and put it in a hash. Then you read in your user config file, a line at a time, pulling out the key and value from the line. Update the hash following whatever rules you want for collisions. Finish by writing your hash as the new user config with its javascript wrapping.
SMOP. I leave the coding as an exercise for the reader. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: complex string matching
by thargas (Deacon) on Nov 04, 2010 at 13:14 UTC |