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)*和 和有什么不一样a*b*?您能否展示更多 Kleene 星形和图案的示例?我在 Google 中搜索了很多网站,但它返回的关于这个主题的结果很少。当我试图了解 PHP 正则表达式的工作原理时,我将不胜感激。
(a|b)*
a*b*
(a|b)* 表示“a 或 b,任意次数”。a*b* 表示“任意数量的 a,然后是任意数量的 b”。所以存在匹配第一个但不匹配第二个的字符串(“baa”、“abba”等)。