编译原理与实践第二章答案.pdfVIP

  • 13
  • 0
  • 约1.58万字
  • 约 13页
  • 2024-01-12 发布于宁夏
  • 举报

TheexercisesofChapterTwo

2.1Writeregularexpressionforthefollowingcharactersets,orgive

reasonswhynoregularexpressioncanbewritten:

a.Allstringsoflowercaselettersthatbeginandendina.

[Solution]

a[a-z]*a|a

b.Allstringsoflowercaselettersthateitherbeginorendina(orboth)

both:a(a|b|c|„|z)*a

c.Allstringsofdigitsthatcontainnoleadingzeros

[Solution]

[1-9][0-9]*

d.Allstringsofdigitsthatrepresentevennumbers

(

文档评论(0)

1亿VIP精品文档

相关文档