How to get Specific Text from PDF using Regex

Hello,

I am trying to get text from PDF using Regex. but somehow it is not giving me desire Output. Can anyone please help.

From Above screenshot I want to get “ESZ0123100263” with Base text as “Számlaszám”

I tried with below expression, but it is not giving output.

(<=Számlaszám\s+\S+\s+\d{4}.\d{2}.\d{2}\s+\d{4}.\d{2}.\d{2}\s+\d{4}.\d{2}.\d{2}\s+\d+/\s*\d+\s)\S+

Attached is my Text file which I converted from PDF and trying to get text from that file.

43223090300002.txt (255 Bytes)

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Match(strData,"(?<=Számlaszám\r?\n.*?)\w+(?=\r?\n|$)").Value

Sample20230913-5L.zip (2.6 KB)

Regards,

1 Like

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