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.
我想返回字符串中给定搜索字符串的匹配项。加上搜索字符串之后的下一个单词。
要搜索的短语:“foobar foo”
示例输入:
foo foobar foo bar1 foobar1 foobar foos bar2 foobar2 foo barfoobar foos bar3 foobar3
期望的比赛:
foobar foo bar1 foobar foos bar2 barfoobar foos bar3
使用正则表达式模式
\b\w*foobar foo\w*\s+\w+\b