in reply to Best parsing module to use?
I think Text::Balanced will not be a good solution because the square brackets are not always balanced in your example. The markup doesn't really look like HTML either; there are no closing or empty tags anywhere. As you demonstrate, there is the possibility of arbitrary nesting at least a few levels deep, so doing the whole thing with a regex would be a mess. If anything, this format has a resemblance to POD.[ INSERT sample.jpg
If I were approaching your parsing problem, I would create a grammar first. I would then either use Parse::RecDescent if speed is not an issue, or create a hand-crafted parser if it was.
-Mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Best parsing module to use?
by supergiantrobot (Acolyte) on Apr 19, 2004 at 16:49 UTC |