Re: help with regular expressions

Gene Wirchenko <genew@mail.ocis.net>
12 Oct 2004 00:52:08 -0400

          From comp.compilers

Related articles
help with regular expressions johndoe@yahoo.com (keith) (2004-10-09)
Re: help with regular expressions cdc@maxnet.co.nz (Carl Cerecke) (2004-10-12)
Re: help with regular expressions genew@mail.ocis.net (Gene Wirchenko) (2004-10-12)
Re: help with regular expressions jeremy.wright@microfocus.com (Jeremy Wright) (2004-10-12)
Re: help with regular expressions torbenm@diku.dk (2004-10-12)
| List of all articles for this month |

From: Gene Wirchenko <genew@mail.ocis.net>
Newsgroups: comp.compilers
Date: 12 Oct 2004 00:52:08 -0400
Organization: Posted via Supernews, http://www.supernews.com
References: 04-10-077
Keywords: lex
Posted-Date: 12 Oct 2004 00:52:08 EDT

keith <johndoe@yahoo.com> wrote:


>Guys I was just solving an exercise in the book Modern Compiler
>Implementation in Java and one of the exercises reads:
>
>write the regular expression for strings over the alphabet {a,b,c}
>that don't contain the contiguous substring baa. I've come up with
>this:
>
>(a|c|(ba(b|c))|bb|bc)*
>
>??? Is this correct?


            No. Going with the consecutive choices bb, a, a results in a
baa.


[snip]


Sincerely,


Gene Wirchenko


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.