regular expression的两个问题,急啊~

来源:百度知道 编辑:UC知道 时间:2024/06/05 07:24:46
regular expression

1.give a regular expression defining the set of all string over {a,b} that do not contain the substring ab.

2.give a regular expression defining the set of all strings over{a,b,c}that contain exactly two occurrences of c.
请用写这种形式的答案,谢谢了~
For example,a regular expression is constructed to represent the set of strings over{ab} that do not contain the substring aa.
Answer:b*(ab+)*∪b*(ab+)*a

1.Answer:b*a*
2.Answer:(a|b)*c(a|b)*c(a|b)*

不懂

1 /[ab](?!ab)/

2 /[abc](.+?)c/

1.give正则表达式定义的所有字符串超过(甲,乙) ,但不包含子抗体。

2.give正则表达式定义的所有字符串超过(甲,乙,丙)到底包含两个发生角

正则表达式,忘了