Preciso de uma ajuda novamente com Regex! Preciso editar um arquivo xml e inserir após uma determinada informação uma sequência de instruções. Porém não consigo selecionar toda a informação que necessito. Preciso selecionar a seguinte informação:
<testerconfirmation title="Tester Confirmation " passedbutton="yes" timeoutresult="failed">REQUIREMENT SPECTED
After T_Checkdisplay (5 seconds), the indication OIL CHANGE REQUEST V3 must be activated according to indications characteristics during 5 seconds.
Press YES to continue.</testerconfirmation>
No caso a cima preciso selecionar toda a informação que esteja dentro da tag e contém a informação OIL CHANGE REQUEST V3. Após encontrar esta informação preciso inserir algumas linhas de código depois da informação selecionada. Estas são as linhas que quero adicionar:
<capltestfunction title="RUN INSPECTION" name="RunInspection">
<caplparam type="string" name="InspName" />
</capltestfunction>
<capltestfunction title="ADD IMAGE TO REPORT" name="AddInspectionImageToReport" />
<capltestfunction title="CHECK ST_F-4" name="CheckStepResultCamera">
<caplparam type="string" name="StepName">ST_F-4</caplparam>
<caplparam type="float" name="ExpVal">1</caplparam>
<caplparam type="float" name="ToleranceUnits" />
<caplparam type="float" name="TolerancePercent" />
</capltestfunction>
<capltestfunction title="CHECK ICON_F-4" name="CheckStepResultCamera">
<caplparam type="string" name="StepName">ICON_F-4</caplparam>
<caplparam type="float" name="ExpVal">1</caplparam>
<caplparam type="float" name="ToleranceUnits" />
<caplparam type="float" name="TolerancePercent" />
</capltestfunction>
<capltestfunction title="CHECK MESSAGE PB058_1" name="CheckStepResultCameraText">
<caplparam type="string" name="StepName">TM_PB058_1</caplparam>
<caplparam type="string" name="ExpVal">OilChange</caplparam>
<caplparam type="int" name="ContainsExpVal" />
<caplparam type="int" name="TolerateSimilarChars">1</caplparam>
</capltestfunction>
<capltestfunction title="CHECK MESSAGE PB058_2" name="CheckStepResultCameraText">
<caplparam type="string" name="StepName">TM_PB058_2</caplparam>
<caplparam type="string" name="ExpVal">Required</caplparam>
<caplparam type="int" name="ContainsExpVal" />
<caplparam type="int" name="TolerateSimilarChars">1</caplparam>
</capltestfunction>
Então o código da seguinte forma:
<testerconfirmation title="Tester Confirmation " passedbutton="yes" timeoutresult="failed">REQUIREMENT SPECTED
After T_Checkdisplay (5 seconds), the indication OIL CHANGE REQUEST V3 must be activated according to indications characteristics during 5 seconds.
Press YES to continue.</testerconfirmation>
<capltestfunction title="RUN INSPECTION" name="RunInspection">
<caplparam type="string" name="InspName" />
</capltestfunction>
<capltestfunction title="ADD IMAGE TO REPORT" name="AddInspectionImageToReport" />
<capltestfunction title="CHECK ST_F-4" name="CheckStepResultCamera">
<caplparam type="string" name="StepName">ST_F-4</caplparam>
<caplparam type="float" name="ExpVal">1</caplparam>
<caplparam type="float" name="ToleranceUnits" />
<caplparam type="float" name="TolerancePercent" />
</capltestfunction>
<capltestfunction title="CHECK ICON_F-4" name="CheckStepResultCamera">
<caplparam type="string" name="StepName">ICON_F-4</caplparam>
<caplparam type="float" name="ExpVal">1</caplparam>
<caplparam type="float" name="ToleranceUnits" />
<caplparam type="float" name="TolerancePercent" />
</capltestfunction>
<capltestfunction title="CHECK MESSAGE PB058_1" name="CheckStepResultCameraText">
<caplparam type="string" name="StepName">TM_PB058_1</caplparam>
<caplparam type="string" name="ExpVal">OilChange</caplparam>
<caplparam type="int" name="ContainsExpVal" />
<caplparam type="int" name="TolerateSimilarChars">1</caplparam>
</capltestfunction>
<capltestfunction title="CHECK MESSAGE PB058_2" name="CheckStepResultCameraText">
<caplparam type="string" name="StepName">TM_PB058_2</caplparam>
<caplparam type="string" name="ExpVal">Required</caplparam>
<caplparam type="int" name="ContainsExpVal" />
<caplparam type="int" name="TolerateSimilarChars">1</caplparam>
</capltestfunction>
Estou usando o Notepad ++, porém se tiverem alguma solução ou experiência com algum outro Sw que facilite trabalhar com código por favor deixe um comentário que também será bem vindo! Obrigado a todos!