[已解决]包含指定字符串查找内容的正则表达式
本帖最后由 xzf680 于 2024-4-9 14:31 编辑如以下内容
Title BENZOEM
substance1 = "IBENZ123"
introduce (BENZ895kkk)
Data1 Q_BENZ
Data2
1 = "BENZ"
2 = "DOCTXT123"
3 = "2016-2024"
Frame xxxx-xxxx-xxxx
END
Title BMWOEM
substance1 = "IBMW123"
substance2 = "IBMW456"
introduce (BMW666llll)
Data1 #Q_BMW
Data2
1 = "BMW"
2 = "DOCTXT123"
Frame xxxx-xxxx-xxxx
END
Title AUDIOEM
substance1 = "IAudi123"
substance2 = "IAudi456"
substance3 = "IAudi789"
introduce (AUDIO5555PP)
Data1 Q_Audi
Data2
1 = "AUDI"
2 = "DOCTXT123"
3 = "2018-2024"
Frame xxxx-xxxx-xxxx
END
请正则表达式大神帮忙一下:
#不固定在哪一组,假设#在BMW这组,通过#要取4个元素,分别是BMWOEM,BMW666llll,#Q_BMW,Data2的所有内容(取Data2与Frame之间的内容)要怎么写 (?is)title\h+(\S+)\h*\v+[^#\(\)]*?\((\V+)\)[^#\(\)]*?(\#\S+)[^#]*?data2\h*\v+(.+?)\v+\h*frame zghwelcome 发表于 2024-4-7 20:25
(?is)title\h+(\S+)\h*\v+[^#\(\)]*?\((\V+)\)[^#\(\)]*?(\#\S+)[^#]*?data2\h*\v+(.+?)\v+\h*frame
正则玩得好。
哎,现在真的懒得看帖子了。
(?is)Title\s*?(\S+).+?introduce\s*?\((\S+?)\).+?Data1\s(#\S+).+?Data2\s*?(\S.+?)\v\s*?Frame 感谢两位,完美
页:
[1]