Regular expression match problem

Hi I am facing issue while extracting some information from the Text using Regular Expression. I have attached sample text [attachment Moderated] and I want following information out of it,

Type Location Name for P : Example company 1, TN 38141
Type Location Name for D : Example company 2, CA 92551
Actv Date for P : 09/09/2020
Actv Date for D : 09/17/2020
BOL : 5028124
PCS : 48 PLT
Stop Ref. Number : 5028124

Thank you.

1 Like

Hi @shandilya.suthar15,

if you are reading this from PDF, check Preserve Format in property panel and extract the details and give it in Note pad.

1 Like

I see many locations which starts from P and D, which one you need?

Hi @Pradeep_Shiv I want all the locations for P and D, So both P and D will have individually 6 matches of locations for this pdf.

@shandilya.suthar15 Please refer below


Similarly you can do for D location

Thank you @Arpit_Kesharwani. This one is capturing whole information after ‘P’. I want separate information, for example for the second match I need below information using separate expressions,

Type Location Name for P : Example company 1, TN 38141
Type Location Name for D : Example company 2, CA 92551
Actv Date for P : 09/09/2020
Actv Date for D : 09/17/2020
BOL : 5028124
PCS : 48 PLT
Stop Ref. Number : 5028124.

And I need this kind of info for all the six matches.

And as per your Regex ‘(?<=P ).*’, it would capture only using single character ‘P’. Is it possible to get match using whole text like ‘Type P’. Because if there will be any other character ‘P’ anywhere in pdf it would break the result.

Thank you.

1 Like

Try this
@shandilya.suthar15,

(?<=\s[P]\s).*

Cheers
@shandilya.suthar15