问题:
尝试获取所有 guid = guid 的匹配项。我希望收到一组匹配项,其中一个匹配项如下所示:
{9659BAE5-632F-4195-BD5D-414C1F2C1066} = {6E298F2A-129A-4491-B053-F12D67561572}
我正在尝试匹配GlobalSection(NestedProjects) = preSolution
和之间的所有 guid = guid EndGlobalSection
。文件中还有其他地方 guid = guid 存在。
这是一个数据片段:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Applications\", "{297BE1A3-A6A3-4835-BB87-63B4B4E2AE0D}"
ProjectSection(ProjectDependencies) = postProject
{A459406A-94FF-4CA9-8183-C7472419CC7D} = {A459406A-94FF-4CA9-8183-C7472419CC7D}
EndProjectSection
EndProject
GlobalSection(NestedProjects) = preSolution
{3D84A2B1-536D-4953-B331-D86E421905E7} = {AF46FD2E-710D-49CD-A203-CB0F8B7EF415}
{02CB05EC-6902-417E-AD50-B3910B245B22} = {2F54A6F1-5D32-4673-8AEE-B845CC622D64}
{DE303EF0-E3B1-4BA9-8CB3-544D37D29576} = {2F54A6F1-5D32-4673-8AEE-B845CC622D64}
{5A095236-0EE1-4480-B7A6-833ECCFE4257} = {AF070137-227F-42F7-9487-00CB26C46E04}
{6CCA189C-0D45-4E80-8486-38AB3E625E69} = {AF070137-227F-42F7-9487-00CB26C46E04}
{EAE3152A-C003-4E39-BFB7-B4F7CACE1606} = {AF070137-227F-42F7-9487-00CB26C46E04}
{9659BAE5-632F-4195-BD5D-414C1F2C1066} = {6E298F2A-129A-4491-B053-F12D67561572}
EndGlobalSection
EndGlobal
我试过的:
这是我用来匹配 guid = guid 的内容
{[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}} = {[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}}
这很好用,只是它显然不区分比赛的位置。所以我从文件的其他部分收到了其他匹配项。我一直在尝试像这样使用正面的外观(有很多变化):
(?<=GlobalSection\(NestedProjects\) = preSolution(\r\n|.)+?)
我是在滥用向后看还是其他什么?