Hi y’all, I have this string and I just need the values of 4 pointers using regex. Can somebody please help me? Delivery due, Topic AND {Remove non-HMM due} will remain constant.
Input :
Delivery Due
Topic
• HMM Oversized Tshirt
• HMM Oversized Tshirt (1)
• HMM Jeans (1 - Torn)
• BMM Blazer (1)
{Remove non-HMM due}
Output
• HMM Oversized Tshirt
• HMM Oversized Tshirt (1)
• HMM Jeans (1 - Torn)
• BMM Blazer (1)
Hi @Tanmay_V_Chetule
(?<=Delivery Due[\s\S]*?)(• HMM[^{]*)
Input="Delivery Due
Topic
• HMM Oversized Tshirt
• HMM Oversized Tshirt (1)
• HMM Jeans (1 - Torn)
• HMM Blazer (1)
{Remove non-HMM due}"
Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=Delivery Due[\s\S]*?)(• HMM[^{]*)").Value
Hope it helps!!
what if some value doesnt start with HMM?
Parvathy
(PS Parvathy)
December 8, 2023, 1:27pm
4
Hi @Tanmay_V_Chetule
Input="Delivery Due
Topic
• HMM Oversized Tshirt
• HMM Oversized Tshirt (1)
• HMM Jeans (1 - Torn)
• HMM Blazer (1)
{Remove non-HMM due}"
Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=Delivery Due[\s\S]*?)(•\s[A-Z].*)").Value
Hope it helps!!
@Tanmay_V_Chetule
Try below once
(?<=Delivery Due[\s\S]*?)(•[^\r\n]+)
Hello
Take a look here
Here is a simplified version where you can change the start and finish values.
Hopefully this helps
Cheers
Steve
Parvathy:
(•\s[A-Z].*)
When I AM USING this in UiPath, It gives out only 1st value i.e • HMM Oversized Tshirt.
Can we utilize the last line i.e {Remove non-HMM due} too for complete extraction?
Parvathy
(PS Parvathy)
December 8, 2023, 3:12pm
8
@Tanmay_V_Chetule
Use the given regex in Find Matching Patterns activity and store the output in a variable. The variable is of DataType IEnumerable(Match).
You need to run a For each fir that variable and you can print the currentItem.
Hope you understand!!
system
(system)
Closed
December 11, 2023, 3:13pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.