I need some help again with Regex! I need to edit an xml file and insert a sequence of instructions after a given information. But I can not select all the information I need. I need to select the following information:
<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>
In the case above, I need to select all information that is inside the tag and contains the OIL CHANGE REQUEST V3 information. After finding this information I need to insert some lines of code after the selected information. Here are the lines I want to add:
<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>
Then the code looks like this:
<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>
I'm using Notepad ++, however if you have any solution or experience with some other Sw that makes working with code please leave a comment that will also be welcome! Thank you all!