How do I extract words that are in brackets in Word Document using UiPath?


May I know how I can get words that are in brackets in Word Document ?
I have tried using screen scraping and data scraping but it only allow me to select the whole thing.
Are there any methods that allow me to select certain words ?

Thank you

extract using screen scraping

then use Regex (regular expression to get your word inside bracket)

Read about regex… its the perfect fit for what you want

else other option is string manipulation… lots of options there

You can use this regular expression


This will extract text inside paranthesis

(?<=[).+?(?=]) for square brackets

Hi neonova,

Thanks for your reply :slight_smile:
Is it possible if I use Read Text instead of screen scraping and then use Regex ?

You can use any method to extract as per your choice . The main part is the second part where you need to extract the data using Regex/string manipulation

choose whatever you are comfortable with :slight_smile:

Hi farhan94,

Thanks for your reply :slight_smile:
I will try this expression and let you know!

Thank you!

1 Like

Hi neonova,

Thank you I will try it out! :slight_smile:

Good one…Clear my doubt also

Hi KarthikByggari,

Thank you for your suggestion! :slight_smile:

Hi farhan94,

I have tried the expression however I could not read the output.
I tried to assign the output to a variable and add .ToString behind the variable, but it shows this

How can I read the output of the regular expression?

Thank you

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