How to get matching word or series of matching words


I am having a following doubt in regex.

  1. I will be having a Word or a series of words.
  2. I want to pass it is a string.
  3. Depending on the regex i want to return all the matching word or words. Or it should have true or false as result how to achieve it in uipath.
1 Like

hey @monish06

  • if you want to extract Specific text you can use Matches activity and pass the string and pattern!
  • if you want boolean result you can use IsMatches activity.



Thank you for your reply, but am not getting the exact match since my string has spaces, is it something with my pattern?

1 Like

what are you trying to extract?
can i see?

For example, I will be having a string like this “Spotify USA Pvt Ltd”, I want to pick the first or match word across this line. Let say, now I want to search USA in the above line if it matches it should return the matching word. Similar to this example, I will be having another words like “Nike is a sports brand in USA” Now I want to search for the words “Nike is a sports brand” if it matches it should return the matching words.

what pattern you are using for this?

This one (Ui\s{0,}Path) it fetches only the first word.

okay for example
“Spotify USA Pvt Ltd” this is your string and you want to search USA here if it matches you want the output as USA or how is it like?

yes it should come like that but now it fetches only spotify. And also What ever words or line I pass it it should check if it matches and return the matched value. But I am getting only the first word.

1 Like

you can give like this!


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