Re: String processing

2007-10-23 Thread Mark Wagner
On 10/23/07, Matthew Whipple <[EMAIL PROTECTED]> wrote: > Mark Wagner wrote: > > I'm working on a program to process Wikipedia pages. Wikipedia pages > > can contain templates of the form: > > > > {{template name > > |key = value > > |key2 = value2 > > |... > > }} > > > > Any value may in turn be

Re: String processing

2007-10-23 Thread Dr.Ruud
"Mark Wagner" schreef: > I'm working on a program to process Wikipedia pages. Wikipedia pages > can contain templates of the form: > > {{template name > |key = value > |key2 = value2 > | ... > }} > > Any value may in turn be a template, with essentially no limit to the > level of nesting. Given

Re: String processing

2007-10-23 Thread Matthew Whipple
Mark Wagner wrote: > I'm working on a program to process Wikipedia pages. Wikipedia pages > can contain templates of the form: > > {{template name > |key = value > |key2 = value2 > |... > }} > > Any value may in turn be a template, with essentially no limit to the > level of nesting. Given a "key

Re: String processing

2007-10-23 Thread yitzle
Recursion is the way I'd solve something like this. Start processing the data, line by line, and when you hit a 'begin template' ({{), recursively process it. An example of a nested template and a sample of what you are trying to generate might make it easier to be specific about the solution --