【发布时间】:2020-06-16 18:48:23
【问题描述】:
是否有一种模式可以从字符串中的多个选项中查找是否只有一个匹配项?
假设我们有以下潜在匹配列表:
`foo|bar|baz`
我们有字符串:
`Foo bar, Cambaz!` // shoud not match due to multiple findings
`My bar, good!` // shoud match for `bar`
`My friend, Cambaz!` // shoud match for baz
不区分大小写。
【问题讨论】:
-
请展示你的尝试
-
@anubhava 老实说,我不知道! :))