RegEx / computer theory - construct a regEx in alphabetical order

后端 未结 2 1023
生来不讨喜
生来不讨喜 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:15

    As far as I understand, you want to capture strings with the following format:

    • The string contains any number of a's, afterwards any number of b's, then any number of c's, and so on...

    Let's consider a derived example: We want all strings consisting of 0 and 1 and that has all 0's before 1's: Therefore, we can simply write 0*1*. Now try to adapt the pattern for more complex alphabets.

提交回复
热议问题