sampath meka

sampath meka

  • NA
  • 94
  • 31.2k

Regular expression for the string in a File

Dec 4 2014 8:33 AM
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 
 
 
 

Answers (4)