Re: help with regular expressions

Jeremy Wright <jeremy.wright@microfocus.com>
12 Oct 2004 00:54:01 -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: Jeremy Wright <jeremy.wright@microfocus.com>
Newsgroups: comp.compilers
Date: 12 Oct 2004 00:54:01 -0400
Organization: Micro Focus
References: 04-10-077
Keywords: lex
Posted-Date: 12 Oct 2004 00:54:01 EDT

keith wrote:


> 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. This RE accepts strings such as "bbaa" and "babaa". Also it does
not allow valid strings that have the suffix "ba" or "b".



Post a followup to this message

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