Regular Expression - Capture Text B/W Words

Hi, I need to capture the data between “Use this section for explanations and special requests. Identify Question and Section numbers.” and “PT”. How to write a regex for the below image? I have attached the sample pdf image. if there is data , the value should get printed in csv and if there is no data there is no data printed in csv.
tempsnip
Expected output:
image

1 Like

@Lalitha_Selvaraj
There is no data between “Use this section for explanations and special requests. Identify Question and Section numbers.” and “PT” can you put the sample pdf and your requirement clearly

@Lalitha_Selvaraj

If it is two different words or sentences then you can just use split and get the data

str.Split({"Sentence1"},StringSplitOptions.None).Last.Split({"Sentence2"},StringSplitOptions.None).First

Cheers

2 Likes

Hi @Anil_G . If we have 2 pages with same 2 sentences what to do? How to use this expression?
temp2
temp1.
I need to print both the page values in csv.
expected output:
image

@Lalitha_Selvaraj

  1. Read both pages separately you have an option to select page numbers
  2. Read all pages and try this str.Split({"Sentence1"},StringSplitOptions.None).Skip(1).Select(function(x) x.Split({"Sentence2"},StringSplitOptions.None).First).ToArray - this would give you array of strings as you need
    cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.