Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何为字母集中的字符串定义一个正则表达式,{a,b}其中字符串只有 2a秒?
{a,b}
a
你可以使用类似的东西:
b*ab*ab*
它看起来像这样:
通常的方法是向前看:
^(?=([^a]*a){2}[^a]*$)[ab]*$