Extraction of P-Number from string

Can any one please help me…How to extract the "P"Number along with “P” as per given input…

Input : BEVGRLV MA - OPT GROOMS - TRANSFER FACILITIES AND REMOVE POLE P4-E3646, P26-E456 and P44-E54 AT 14 LENOX - WI-INS 4019811 VSAP 1705231 / 610193281 / wrt# 20880054

Output : “P4”,“P26” and “P44”…

1 Like

@saneeth_kandukuri Is it possible to get more related input Data?

1 Like

Hi,

Here you are.

Main.xaml (5.7 KB)

Regards,

Yoichi

2 Likes

You can use Regex to match those values using this Expression : ([P]\d+)

1 Like

Fine
kindly use this expression
String str_input = “BEVGRLV MA - OPT GROOMS - TRANSFER FACILITIES AND REMOVE POLE P4-E3646, P26-E456 and P44-E54 AT 14 LENOX - WI-INS 4019811 VSAP 1705231 / 610193281 / wrt# 20880054”

then output be like

list_values = system.Text.RegularExpressions.Regex.Matches(str_input,“[P][0-9]+”).ToString

where list_values is a variable of type System.Collections.Generic.IEnumerable(system.Text.RegularExpressions.Regex.Match)

–so pass this variable as input to FOR EACH activity and change the type argument as object
–inside the loop use a writeline activity and mention like this
item.ToString

hope this would helpyou
Cheers @saneeth_kandukuri

2 Likes

Thank you @Palaniyappan

thnk you @supermanPunch

1 Like

thank you @Yoichi

1 Like

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