开发者

Describing RE's in English Language

开发者 https://www.devze.com 2023-03-04 22:19 出处:网络
I have the following question from a past exam paper: I am struggling to formalise their definitions within the necessary 15 word limit. So far I have:

I have the following question from a past exam paper:

Describing RE's in English Language

I am struggling to formalise their definitions within the necessary 15 word limit. So far I have:

i) The empty string or set of strings that contain zero or many a's OR b's OR both

ii) The set of strings that start with one or many a's, unless preceded by b'开发者_如何学Cs, followed by one or many a's with zero or many possible preceding b's.

My definitions seem rather cumbersome...I just don;t want to lose any info by oversimplifying the definition.


Try to simplify the regular expressions before describing them.

i is equivalent to (a | b)* which means any number of a's and b's in any order.

ii is equivalent to (a|b)*a(a|b)*a which is hard to describe in only 15 words, my best attempt is a's and b's in any order, at least two a's, the final letter is a


I have written a tool that attempts to do this for arbitrary regular expressions. You can find it here. Enter your regular expression and change the mode to "Explain."

0

精彩评论

暂无评论...
验证码 换一张
取 消