所有的多行记事本+ 2特定的词与词之间,提取字符串/数据在数据
我一直在试图提取使用正则表达式搜索和替换在记事本2名特定的词++之间的文本,但没有运气,
它让我发现,我试图寻找堆栈溢出,随后通过几个问题,但没有运气的最后一场比赛,我的数据是
Open options for my word1
My Text1
My Text1 Second Line
My Text1 Third Line
Word2 My Fixed Text Word3
Open options for my word1
My Text2
My Text2 Second Line
My Text2 Third Line
Word2 My Fixed Text Word3
Open options for my word1
My Text3
My Text3 Second Line
My Text3 Third Line
Word2 My Fixed Text Word3
Open options for my word1
My Text4
My Text4 Second Line
My Text4 Third Line
Word2 My Fixed Text Word3
Open options for my word1
My Text5
My Text5 Second Line
My Text5 Third Line
Word2 My Fixed Text Word3
Open options for my word1
My Text6
My Text6 Second Line
My Text6 Third Line
Word2 My Fixed Text Word3
Open options for my word1
My Text7
My Text7 Second Line
My Text7 Third Line
Word2 My Fixed Text Word3
,我的正则表达式是.*word1(.*?)Word2.*
,我以$ 1替换它
它给了我正则表达式匹配的最后一次出现的文本,Can Someone可以查看它并告诉我在这里丢失了什么。
我无法在我的系统上复制此问题。你打勾了吗?匹配换行符选项? –
那么,如果你不打开*'.'匹配换行*,它不会取代任何东西。 –