Matches and Regex Problem

Hi, I want to find like the below string from a pdf. It has 2 newline. How can I choose options in the matches activity?

T.C.
DSADSADSAD
AADSADAS DAİRESİ

It must start with “T.C.” and end with “DAİRESİ”

Hi @Hulya_Cetinkaya ,

Try below regex

System.Text.RegularExpressions.Regex.Match(test, “(?=T.C.)([\S\s]*)(?<=DAİRESİ)”).Value

It is good thanks but this gets all the words after “DAİRESİ”, I want it ends DAİRESİ. :slight_smile:

It’s working i believe

Can you share your text ?

T.C.
BURSA
20. İCRA DAİRESİ
2021/7082 ESAS
02/08/2021
BİRİNCİ HACİZ İHBARNAMESİ

  1. Üçüncü şahsın adı, soyadı
    ve adresi : gdgfdgfdgfdgfdgfdgfd
    gfdgfdgfdgfdgfdgfdgfdgfdgfdgfdgfdgfdgf
    gfdgfdgfdgfdgfdgfdgfdgdgfg

Not sure why it’s not working for you.

It’s working fine
image

Can you please share the screenshot of your workflow , how you are using it and what is the output?

grafik

in Assign Activity:

xyz=System.Text.RegularExpressions.Regex.Match(yazi, “(?=T.C.)([\S\s]*)(?<=DAİRESİ)”).Value

*xyz is string

And WriteLine Activity:
xyz

And The result is from T.C. to end of the PDF :slight_smile: