标签: regex ruby
.\s(expect([^.]+.))
即使句子中没有句点,上述内容也会被匹配
例如Avg. Number of Gardening Quotes You Can Expect To Compare
Avg. Number of Gardening Quotes You Can Expect To Compare
仅当句子中带有Expect关键字的句点后才如何严格捕获?
Expect
Avg. Number of Gardening Quotes. Expect To Compare
post
^在rubular中...它不应该匹配任何东西,但是它正在捕获并截断
答案 0 :(得分:0)
仅当句子的句段为带下一个Expect关键字时,我才能严格捕获吗?
要捕获所有内容,取决于positive lookahead的下一个(或之前)。
table1
Rubular example。