How to Spilt the output from Regex

My mail body I have the requirement to print Output as P32546 from the below input text
CONTACT: Pavan Patil (P32546)

With the use of regex expression as (?<=CONTACT: ).* I am getting entire text as Pavan Patil (P32546) but I need only P32546.

Kindly help on the request
Thank you!!

grafik

(?<=CONTACT.*?\().*?(?=\))

Hi @Pavan_Patil

image

Hope it helps!!

Hey @Pavan_Patil ,
Is your required Output always be inside () brackets?
If so You can try this

Split(Split("OutputVariable","(")(1),")")(0)

Regards,

Hi,

This is working but it is selecting other matches also. Please find the screenshot below.

I need the value for CUSTOMER only.

Regards,
Pavan.

It says pattern error

was working in the immediate Panel

grafik

 strText
 "CONTACT: Pavan Patil (P32546)"
 strPattern
 "(?<=CONTACT.*?\().*?(?=\))"
 System.Text.RegularExpressions.Regex.Match(strText, strPattern).Value
 "P32546"

You can try first extracting everything related to CUSTOMER like this: (?<=CUSTOMER: ).* .*

Then target the pattern of (P12376) like this: P(\d+)

(?<=CONTACT: ).*P(\d+) this is giving me output as 12376 but I need the output as P12376.

Try \w+(\d) insted of *P(\d+)

Can you send the entire text to extract the required one

Thanks and Regards

Below is the entire text.
Requirements 1. I want extract P36413 from the text CUSTOMER: Pavan Patil (P36413).
2. I want to the other text at the last line which is “FI_TV_APPROVER”

Work Order WO0000000426294 has been assigned to your group ‘SAP Security (PPW)’.
Customer: Pavan Patil
Contact: ABC
Company: XYZ

Summary: Request Grant
Notes: "A new access request has been requested for the following items:

CUSTOMER: Pavan Patil (P36413)
CUSTOMER SUPERVISOR: ABC (P23242)
CONTACT: XYZ (P42546)

====================================================================================================================================================================================
ITEM | ACCESS GROUP (Source) | BUSINESS NEED

SAP | FI_TV_APPROVER |

Hi @Pavan_Patil

Use the below regex expression to extract the required output from the input.
image

Hope it helps!!

Not working

Hi @Pavan_Patil

Try using the below regex expression:

(?<=\s\()(.\d)+


Note: Attached workflow for reference

Sequence8.xaml (9.2 KB)

Hope it helps!!
Regards,

It is giving output of 3 matches and I need the output corresponding to the CONTACT only.

Can you help me on this?

Hi @Pavan_Patil

Use this regex expression:

(?<=CONTACT:\s+[A-Z]+\s+\()(.\d)+

Hope it helps!!
Regards

Hi @Pavan_Patil
Can you try this

I hope it helps!!


It shows pattern error please find the attchement.