9 Oct 2004 22:55:13 -0400

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) |

From: | keith <johndoe@yahoo.com> |

Newsgroups: | comp.compilers |

Date: | 9 Oct 2004 22:55:13 -0400 |

Organization: | Slovenija OnLine - SiOL |

Keywords: | lex, question |

Posted-Date: | 09 Oct 2004 22:55:13 EDT |

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?

There's also an exercise to write a regular expression for:

binary numbers n such that there exists an integer solution of an+bn=cn,

don't know what to do about this one :-( As far as I am concerned all

binary numbers satisfy this condition as integer+*integer=integer.

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.