Regex expression help

Hi All,

I have below text and I need to get address after @ . This is my expression (?<=@).+ which is giving the entire line. I need to get it till ON. ON is constant for 99 percent of cases.
Text:
P0 # 23751181 Req #1 Ref # Due Date: 06/18/2020
RT INSPECTION @ 2465 HURONTARIO ST. SUDBEERY, ON WE MAY 8/2020 - DAVID.D/J.SHAW ** SHELL
CONTACT MIKE MARKER **

Desired Output as below:
2465 HURONTARIO ST. SUDBEERY, ON

Please try this (?<=@)(.*?)(?=, ON)

1 Like

Hi @vboddu

Below is the Regex for the same :-

image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

@Pratik_Wavhal I need ON as well

Hi @vboddu

Below is the updated Regex :-

image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

need regex help for below text:
ATT: Accounts Payable-Vivek Patel, Jacqueline Clark
Approval: David Smith, Michael Frank REFERENCE: WO# 23865196
REGION QTY PRICE TOTAL
CIVIC ADDRESS
20 50 Sky Harbour Dr -
Brampton, Ontario

CIVIC ADDRESS is constant

Output:
20 50 Sky Harbour Dr -
Brampton, Ontario

Hi @vboddu

Instead of using Regex it will be more efficient by String Manipulation as below :-

str.substring(str.IndexOf("CIVIC ADDRESS")+"CIVIC ADDRESS".Length)

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

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