Is there any other way except RegEx to search specific text?

Hello,

Is it possible to search for specific text such as Due Date: 04/01/2020 from 20 pages of PDF except using RegEx? Or RegEx is the only way to search the text?

I am an aspiring RPA BA and do not have a background in coding so if there’s any activity I could use would be great which needs no coding/or less coding.

Thanks in advance!

Preet

1 Like

@Preet If Due Date is always present as a Keyword before the Date Value and if there’s another constant Keyword after the Date Value then it might be possible to extract the value using Split or Substring methods

Hi
Of course we can with a simple contains method
That is
—use a READ PDF or READ PDF with OCR activity and get the output with a variable of type string named str_input
—now use a IF Condition like this
str_input.ToString.Contains(“Due Date: 04/01/2020”)

If true it will go to THEN part or goes to ELSE part
And if it goes to THEN part there we can use Regex or split or SubString method of string manipulation to obtain that due date value like this
str_date = System.Text.RegularExpressions.Tegex.Match(str_input.ToString,”(?<=Due Date).([0-9]{2})\W([0-9]{2})\W([0-9]{4})”).ToString.Trim

Or

str_date = str_input.ToString.SubString(str_input.ToString.IndexOf(“Due Date”),10).ToString.Trim

Cheers @Preet

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