【发布时间】:2012-08-08 17:18:16
【问题描述】:
我有一个大文本:
"Big piece of text. This sentence includes 'regexp' word. And this
sentence doesn't include that word"
我需要找到以 'this' 开头并以 'word' 结尾但 不 包含单词 ' 的子字符串>正则表达式'。
在这种情况下,字符串:“this sentence doesn't include that word”正是我想要接收的。
如何通过正则表达式做到这一点?
【问题讨论】:
-
您的规则令人困惑,或者您的预期输出有误。为什么没有“和”,为什么没有“大段文字”。
-
@sjakubowski "子串以 'this' 开始,以 'word' 结束"
-
此规则令人困惑但正确。我花了很多时间在谷歌上找东西,但一无所获。
标签: regex