How to extract address from below text

Registered/Client Registered Address:
SF MARINIGUCH TRUST TOWER MAIN 11-8-3 MARUNGUCHI
CHIYODA-KU, TOKYO

I want only below two lines…
Note : It is from notepad text.

Hi,
Where did the text start from?

Hi @Sudheer_Kumar_S - Try below regular expression

Variable of type string Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=Registered\s+Address:)([\n\r]+.*){2}").ToString

Check Attached workflow for ref

SampleWorkflow.zip (4.3 KB)

1 Like

Hi, this reegex will work if there is a text before and after these 3 lines ?

for example…
xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
Registered/Client Registered Address:
SF MARINIGUCH TRUST TOWER MAIN 11-8-3 MARUNGUCHI
CHIYODA-KU, TOKYO
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Tried with this but not working

for example…
xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
Registered/Client Registered Address:
SF MARINIGUCH TRUST TOWER MAIN 11-8-3 MARUNGUCHI
CHIYODA-KU, TOKYO
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hi,

Basically, regex which @ushu suggested works for you even if there are some lines before/after it.

Sequence.xaml (5.0 KB)

How did you check it? Or if there is additional requirement, can you share it?

Regards,

the string follows as below… highlighted text is what i have given… but not giving ouput… when i log this variable it is giving empty… pls help

Purpose for which we are using the document I To confirm client’s legal name, lega requiring translation: number, list of Directons, country and date of formation, date of Corporate Registry and nature of business
CIP Key Information: (Page 1)
Personal Name/Legal Entity Name: RWE RENEWABLES JAPAN G. K.
RWE Renewables JapanfARKit
Registered/Client Registered Address: (Page 1}
5F MARUNGUCHI TRUST TOWER MAIN, 1-8-3 MARUNGUCHI,
CHIYODA-KU, TOKYO
HESTRARAOA-THSEFIZAON FFA FF U-RAE 5 HE
Client Business/Physical Address (if different N/A from Registered/Legal address) :
Tax Identification Number: N/A
Company Registration Number: |

HI,

Because there are some characters after Registered Address.
Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=Registered/Client\s+Registered\s+Address:.*?\r?\n)(.*(\r?\n|$)){2}").Value

Regards,

Can you take only till tokyo…

Registered/Client Registered Address: (Page 1}
5F MARUNGUCHI TRUST TOWER MAIN, 1-8-3 MARUNGUCHI,
CHIYODA-KU, TOKYO

i am getting below lines as well… thanks in advance…

Hi,

Can you try to replace 2 with 3 if you need 3 lines, as the following.

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=Registered/Client\s+Registered\s+Address:.*?\r?\n)(.*(\r?\n|$)){3}").Value

Regards,

Thank you @ushu and @Yoichi

1 Like

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