RegEx / computer theory - construct a regEx in alphabetical order

后端 未结 2 1000
生来不讨喜
生来不讨喜 2021-01-29 04:43

In my grammars - Computer theory class I am trying to create a regular expression in alphabetical order(a-z)

l = {a, b, x, y, z, i, o, u, e, c}
<
2条回答
  •  遥遥无期
    2021-01-29 05:38

    the word must be in alphabetical order, so if it contains any a's, they surely must be at the front. likewise, if it contains any b's , they must come after the a's, and nothing can come in between the a's and b's

    so we have: a*b*...

    and so a pattern emerges.

提交回复
热议问题