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!!
ppr
(Peter Preuss)
June 23, 2023, 8:23am
2
(?<=CONTACT.*?\().*?(?=\))
Jithesh_R
(Jithesh Karkera)
June 23, 2023, 9:18am
4
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.
ppr
(Peter Preuss)
June 23, 2023, 10:25am
7
Pavan_Patil:
It says pattern error
was working in the immediate Panel
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+)
hakon.kristiansen:
P12376
(?<=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
hakon.kristiansen:
\w+(\d)
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 |
mkankatala
(Mahesh Kankatala)
June 23, 2023, 12:29pm
13
Hi @Pavan_Patil
Use the below regex expression to extract the required output from the input.
Hope it helps!!
Parvathy
(PS Parvathy)
June 23, 2023, 12:33pm
15
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,
Parvathy:
(?<=\s\()(.\d)+
It is giving output of 3 matches and I need the output corresponding to the CONTACT only.
Parvathy
(PS Parvathy)
June 27, 2023, 7:02am
18
Hi @Pavan_Patil
Use this regex expression:
(?<=CONTACT:\s+[A-Z]+\s+\()(.\d)+
Hope it helps!!
Regards
lrtetala
(Lakshman Reddy)
June 27, 2023, 7:05am
19
Hi @Pavan_Patil
Can you try this
I hope it helps!!
It shows pattern error please find the attchement.