On Tue, 1 Sep 2009 20:33:22 -0600 Mike Diehl <mdi...@diehlnet.com> wrote: 

MD> Hi all,
MD> I'm struggling with an RD grammar problem and am hoping you can help.

MD> I've got some data that is embedded inside a file and I need to parse only 
the 
MD> embedded data and leave the "noise" untouched.

MD> For example:

MD> afaf asf af <DELIMITER> command command command </DELIMITER> asdf asd qer f 
a

MD> I want to parse the command(s), remove the DELIMITERS and preserve 
everything 
MD> else.

MD> In the past, I've looped over the file with a regex looking for the 
delimeters 
MD> and then running RD on the text inside.  However, the cost of launching 
MD> several instances of the parser is very expensive, about 80% of runtime.

MD> I'd like to be able to use one parser and have it "do" the entire file.

MD> What I've tried amounts to this:

MD> chunk: /.*?/ delimiter_start command(s) delimiter_end /.*?/

MD> However, I think the first regex is eating too much.

MD> Any suggestions on how to do this?

This seems reasonable.  Can you show a full runnable example that fails?

Ted

Reply via email to