Regex in uipath

Hii
I am trying to split Excel sheet with hepl of matches activity .but unable to find expression for spliting strin and dot ie ( Name: Pol P .G) am unable to split it

1 Like

yah we can split it like this
if input is
in_str = “Pol P .G”

then output will be like
out_str = Split(in_str,“.”)

where out_str is a string array variable
to get the specific value
out_str1 = Split(in_str,“.”)(0).ToString.Trim
out_str2 = Split(in_str,“.”)(1).ToString.Trim

Cheers @Bhagyashri

1 Like

yes i know it will work by split function but i want to make work flow for excel data…so want to use match and regex
so that i can build one work flow for all conditions

Hi @Bhagyashri
Use System.text.regularexpression.regex.split("Str","\.")(0) To get Pol P and to get
second part use System.text.regularexpression.regex.split("Str","\.")(1)
Thanks & Regards

Thankyou ,
i wil try let u know


want to give regex in this match activity

@Bhagyashri
What exactly you want ? do you want to split that string or want that text only Pol P Only if yes then (?<=: )\w+\s\w (?=\.). I hope this will help you.

Hi @Bhagyashri
You can try:

([^.])*\.(.*) Or
([^.])+\.(.*)

Grab the Group Number \1 and \2.

1 Like


what to get only names from third column what should i use in match

it is not working :pensive:

its working but i want only names it is giving all the data

@Bhagyashri Can you specify with example input and output you are expecting from the excel.

@Bhagyashri
Instead of using Matches activity i will suggest you to use System.text.regularExpression.regex.Match(Strvar,"\w+"). A s we can see in excel file there is space after every name so it will take the first name every Time.
for your understand i have attached sample workflow.

GetName.xaml (4.6 KB)

output
Shirsat RS
Pol .P.G
Harshita

Yes it is working but i want for all excel data
Thanks for help:upside_down_face:

@Bhagyashri Use this in Loop.

yes trired in for each row…but not giving exact op which i want
Thanks

Hii can we use regex in PDF to take some particular data which might be dynamic? Help me out!!

yes u can …please specify the required output.so i can help u

Suppose There is Bill in PDF format I want [total price] … price may change in each PDF I want to extract that total price using regex ? Can u share some useful link so I can try or u can share any xaml file if u worked before?