Matches Activity returns a object not a value

Hi guys,
I’m trying to extract piece of info from a text file using regex expn by using activity MATCHES and saving result say var1.
And if am try to print the Var1. It returns an object not a value.

And also tell me also while assigning regex expn to a variable how can i add ignore case and dotall.

Help me to solve this!
Thanks in advance !!!


Hi @Sriram07
use a for each loop activity and pass the matches output to the for each loop and now you can assign the value of for each loop Item which will have the value of matches, to a variable you want
like this

or simply mention them with index like this in writeline activity

where outvalue is the output of matches and 0 is the index of the first value

1 Like

The Is Match activity allows you set the ignore case property.

Also, it returns a Boolean variable as its output.

Hi @Sriram07,
Matches indeed returns an object. But then you can use it based on index. like (output of your matches)(0).ToString

Yeah i know this!
I’m asking how to give that while assigning
Say Var1 = system.text.regularexpressions.regex.matches(input,regex)
in that how to add also ignorecase and dotall


Try this:


Took me ages to figure this out. Thanks!

1 Like

Welcome to uipath community