I want to compare two values using regex

I want to compare a variable value, variable is an int, with a online pdf document.
Lets
ABC = 5678

I want to search it in pdf that is in chrome browser.

How should I do it?

Thanks.

@Bhushan_Nagaonkar

You can try using find text activity…an dpass the variable abc.ToString

Cheers

1 Like

Ok, thanks I’ll try

Will it also work for pdf that is viewed in chrome browser

@Bhushan_Nagaonkar

Ideally it shpuld be …I hope the text would be visible and not some where down the pdf

Cheers

1 Like

I don’t have find text activity. Is there some other name to it

Thanks

@Bhushan_Nagaonkar

Please search with get position or get text position

Alternately you can try with click text as well if it fails the text is not present else it is present

Cheers

1 Like

Ok, Ill try and let you know

Thanks

1 Like

Hi @Anil_G

The values are same still it says - false

Is there regex method for this?

@Bhushan_Nagaonkar

You can try using get text activity may be get ocr text or get visible text might work…and then use contains on the extracted data…I dont think you need regex

Extractedtext.contains("188465")

Cheers

The problem is that values keep on changing so I cannot give hardcoded value

I tried get ocr text, with I got the output

@Bhushan_Nagaonkar

Just for illustartion I have given hardcoded you can give a variable as well extractedtext.Contains(strvalue)

If you want to make it case insensitive then use .ToLower on both the sides

Hope this helps

Cheers

Extracted value will be my get text right, that I have compared and strvalue is ??

@Bhushan_Nagaonkar

Extractedvalue will be the output of get text or get ocr text

And strvalue is the variable which contains your value which is to be searched

Cheers

There maybe whitespace characters in the strings. Try to do strVariable.Trim() for both variables before doing a comparison. @Bhushan_Nagaonkar

Ok. I will try and let you know.

Thanks

1 Like

I will try and let you know

Thanks.

@Anil_G & @argin.lerit I tried using get ocr text and image region selection.

It worked. Thanks for your time and effort.

2 Likes

@Bhushan_Nagaonkar

Happy Automation

cheers

1 Like

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