Read pdf text with regex

Hi all,
Please see the screenshot for your reference.


I want to get the <NAGOYA,JAPAN> value, but i do not know how to do, please help.
.NET Regex Tester - Regex Storm
The file is here :
test.txt (1.6 KB)

Hey!

Try this:

System.Text.RegularExpressions.regex.Match(StrInputVariable,"(?<=\D{3}.\d{2}.\d{4}).*(?<=\D)").ToString.Trim

Reference:

Reference 2:

Regards,
NaNi

Hi,

Can you try the following expression? This will return word after date at next line of “NAME OF VESSEL ON OR ABOUT LOADING PORT”

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=NAME OF VESSEL ON OR ABOUT LOADING PORT\r?\n.*?(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\.\d{2},\d{4}\s*).*").Value

Regards,

Hello @Chen-Jim Try this expression

(?<=[A-Z]{3}.\d{2},\d{4}\s+).*

Hello,
Please see the attachment for your reference, the output is null…
BlankProcess.zip (52.9 KB)

Hi,
Please help me to check, thanks.
BlankProcess.zip (52.8 KB)

Hi,

How about the following?

System.Text.RegularExpressions.Regex.Match(sPdfText,"(?<=NAME\s+OF\s+VESSEL\s+ON\s+OR\s+ABOUT\s+LOADING\s+PORT(\r?\n)+.*?(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\.\d{2},\d{4}\s*)\w.*").Value

BlankProcess20220725.zip (53.0 KB)

Regards,

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