Extract data using regex

thanks

(?<=Line 1 - 109 - )[\s\S]+(?=\r?\n?Line 2)

sorry to distrub you again, but still have small issue, this -109 so 109 is random no, changed in every record.

@ashishmani - I have made the space and digits as dynamic, assuming there is at least 1 space between each characters Line(space)1(space)-(space)109(space)-(space)

 (?<=Line\s+1\s+-\s+\d+\s+-\s+)[\s\S]+(?=\r?\n?Line 2)

image

Line 1 - 6 - THE PROCEDURE/REVENUE CODE IS INCONSISTENT WITH THE PATIENT’‘S AGE-N129 - NOT ELIGIBLE DUE TO THE PATIENT’'S AGE

now the sentence is above.
sometime here only 1 line desciption

@ashishmani - Provide all the variations clearly…Regex won’t work if your pattern changes…

Line 1 - thios part is fix on every data,
some tym thier is 2 or more the two line description the line 2 and line 3 and soo on are thier,
some time only 1 line descrption are thier

@ashishmani - One thing i can think of this…

  1. Check if your Input string contains “Line 2” if yes , then use the below pattern

    (?<=Line\s+1\s+-\s+\d+\s+-\s+)[\s\S]+(?=\r?\n?Line 2)
    
  2. if not, use this pattern…

    (?<=Line\s+1\s+-\s+\d+\s+-\s+)[\s\S]+ 
    

Hope this helps…