How i can extract value between this two strings

String 1: Address Line 1:3080 N 1st St Address Line 2: Address Line 3: Address Line 4: City:San Jose State:CA Postal Code:95134 County:Santa Clara Province: Country:United States Primary Flag:N Party Site Usage:SOLD_TO Customer Name:Micron Technology Inc

I need to extract value between address line 1 and address line 2. Please help me to do that.

Hi @Salman_Faries

Check the below one,

(?<=Address Line 1:).*(?=\s*Address Line 2:)

Check the below image for better understanding,

Hope it helps!!

1 Like
- Assign -> Input = "Address Line 1:3080 N 1st St Address Line 2: Address Line 3: Address Line 4: City:San Jose State:CA Postal Code:95134 County:Santa Clara Province: Country:United States Primary Flag:N Party Site Usage:SOLD_TO Customer Name:Micron Technology Inc"

- Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input.ToString,"(?<=Address Line 1:).*(?=\s*Address Line 2:)").Value

Check the below workflow for better understanding… @Salman_Faries

Hope it helps!!

1 Like

@Salman_Faries

You can use split activity directly

str.Split({"Address Line 1:","Address Line 2:"},StringSplitOptions.RemoveEmotyEntries).First

cheers

Tnx a ton for this :heart:

1 Like

It’s my pleasure… @Salman_Faries

Happy Automation!!

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