Hello All,
I have a file which contains the below contains
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_conditional_switches.h 1.7.1.1 d:\Sandbox\SCS_Core_Based\ABS\ABS_GEN1\MAIN\APPLICATION\abs_axle_behavior\abs_conditional_switches.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_constants.h 1.7.1.4 d:\Sandbox\SCS_Core_Based\ABS\ABS_GEN1\MAIN\APPLICATION\abs_axle_behavior\abs_constants.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_functions.h 1.5.1.1 d:\Sandbox\SCS_Core_Based\ABS\ABS_GEN1\MAIN\APPLICATION\abs_axle_behavior\abs_functions.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_code_operation_time.c 1.2 d:\Sandbox\SCS_Core_Based\ABS\ABS_GEN1\MAIN\APPLICATION\abs_code_operation_time\abs_code_operation_time.c
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_conditional_switches.h 1.7.1.1 d:\Sandbox\SCS_Core_Based\ABS\ABS_GEN1\MAIN\APPLICATION\abs_code_operation_time\abs_conditional_switches.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_constants.h 1.7.1.4 d:\Sandbox\SCS_Core_Based\ABS\ABS_GEN1\MAIN\APPLICATION\abs_code_operation_time\abs_constants.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_functions.h 1.5.1.1 d:\Sandbox\SCS_Core_Based\ABS\ABS_GEN1\MAIN\APPLICATION\abs_code_operation_time\abs_functions.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_conditional_switches.h 1.8.1.1 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Abs\Abs_Main\_abs_axle_behavior\abs_conditional_switches.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_constants.h 1.8.3.2 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Abs\Abs_Main\_abs_axle_behavior\abs_constants.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_functions.h 1.6 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Abs\Abs_Main\_abs_axle_behavior\abs_functions.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_code_operation_time.c 1.2 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Abs\Abs_Main\_abs_code_operation_time\abs_code_operation_time.c
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_conditional_switches.h 1.8.1.1 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Abs\Abs_Main\_abs_code_operation_time\abs_conditional_switches.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_constants.h 1.8.3.2 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Abs\Abs_Main\_abs_code_operation_time\abs_constants.h
/SCS/SCS_Core_Based/08_Software/Application/ABS/ABS_GEN1/MAIN/APPLICATION/SOURCE/abs_functions.h 1.6 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Abs\Abs_Main\_abs_code_operation_time\abs_functions.h
for the above contents after loading the file in the container if i give the input has "\abs_axle_behavior\" i need to get all the lines which contains "\abs_axle_behavior\" and "\_abs_axle_behavior\" using regular expression kindly help me with this.
Kindly help me with the regular expression.
Thanks & Regards,
Sampath

VulpesRank #55 · 29.2K reputationPosted Dec 4, 2014, 4:23 AM EST
Here's the same code in VB.NET:
VulpesRank #55 · 29.2K reputationPosted Dec 4, 2014, 4:10 AM EST
The output is:
sampath meka90 reputationPosted Dec 4, 2014, 8:23 PM EST
your answer is correct but the provided files are very huge files which contains more than 30,000 lines so i need to get all the lines with matches for the expression.I have done some code in vbs which i will provided .In this i am reading all lines from a file to container (readAllTestview)
search= "\abs_axle_behavior\"
lentxt= Len(search)
Set reg = New RegExp
reg.MultiLine = True
reg.Global = True
regExpBuildview ="\_?" + search + "\"
reg.Pattern =regExpBuildview
For Each m In mc
MsgBox m.Value
msgbox mc.count
Next
I implemented the expression in vbscript but this is not working.
here what i should get mc.count is total matches m.Value is the entire line.
The output should be same but expression should be implemented to entire file.
Sorry to trouble you this should work in vbscript.
Thanks & Regards
Sampath
sampath meka90 reputationPosted Dec 4, 2014, 8:44 PM EST
I have changed and tried its working fine Thanks for your help.If i have any more queries i will get back..
Thanks & Regards,
Sampath