这可以简化以避免重复吗?最好不要有重复的组。
这是我的正则表达式的结构化输出,具有声誉:
^(?<Version>(\d+)\.(\d+)\.(\d+))(?!.*[\.-]$)(?:(?<IsReleaseVersion>-)(?:(?:(?<RArea1>[\da-z][\.\da-z-]+)\.(?<RStep1>[\d]+)\.(?<RHash1>[\.\da-z]+)\.(?<RCiId1>\d{1,4}))|(?:(?<RArea2>[\da-z][\.\da-z-]+)\.(?<RStep2>[\d]+)\.(?<RId2>[\.\da-z]+))|(?:(?<RArea3>[\da-z][\.\da-z-]+)\.(?<RStep3>[\d]+))|(?:(?<RArea4>[\da-z][\.\da-z-]+))))?(?:(?<IsBuildVersion>\+)(?:(?:(?<BArea1>[\da-z][\.\da-z-]+)\.(?<BStep1>[\d]+)\.(?<BId2>[\.\da-z]+)\.(?<BCiId2>\d{1,4}))|(?:(?<BArea2>[\da-z][\.\da-z-]+)\.(?<BStep2>[\d]+)\.(?<BId2>[\.\da-z]+))|(?:(?<BArea3>[\da-z][\.\da-z-]+)\.(?<BStep3>[\d]+))|(?:(?<BArea4>[\da-z][\.\da-z-]+))))?$
这是输入文本:
<Version>: (A)=1.0.1 (B)=1.0.1 (C)=1.0.1 (D)=1.0.1 (E)=1.0.1 (F)=1.0.1 (1): (A)=1 (B)=1 (C)=1 (D)=1 (E)=1 (F)=1 (2): (A)=0 (B)=0 (C)=0 (D)=0 (E)=0 (F)=0 (3): (A)=1 (B)=1 (C)=1 (D)=1 (E)=1 (F)=1 <IsReleaseVersion>: (A)=null (B)=null (C)=null (D)=null (E)=null (F)=- <IsBuildVersion>: (A)=+ (B)=+ (C)=+ (D)=+ (E)=null (F)=null <Area>: (A)=beta (B)=beta (C)=beta (D)=beta (E)=null (F)=beta <Step>: (A)=1 (B)=1 (C)=1 (D)=null (E)=null (F)=1 <Id>: (A)=abcd1234 (B)=abcd1234 (C)=null (D)=null (E)=null (F)=abcd1234 <CiId>: (A)=0001 (B)=null (C)=null (D)=null (E)=null (F)=null
我希望有人能帮助我!