From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glynn Clements Subject: Re: Pattern matching programming Date: Fri, 20 May 2005 21:36:33 +0100 Message-ID: <17038.19025.312174.566505@gargle.gargle.HOWL> References: <33128.200.91.100.219.1116437772.squirrel@www.crearium.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <33128.200.91.100.219.1116437772.squirrel@www.crearium.com> Sender: linux-c-programming-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: fabio@crearium.com Cc: linux-c-programming@vger.kernel.org fabio@crearium.com wrote: > I am trying to code a small C program that basically takes a long text > file with data that comes from a mysql server. > > But I realize It is better to use regular expression. This is an examples > of the text: > > =1

blah

{$foobar}
blah....

linux rulez

> misc characters.... =2 blah blah

linux rulez again

....

foo or, worse still, or hand-coded equivalents) is a recipe for producing a parser that is at worst incorrect (i.e. will produce the wrong result in some cases) and at best inefficient (it isn't hard to end up with a parser which is a hundred times slower than an optimal lex-generated one). -- Glynn Clements