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,C},我想匹配
A、B、C、AB、AC、BC、ABC
基本上所有组合(除了空字符串)都取自一个集合而无需替换。
编辑:我希望能够使用 POSIX“grep -E”来做到这一点。
尝试:
^(([abc])(?!.*\2))*$
演示