Regular expression - Strings

Hi, I have attached the sample text file which contains input and expected output. Here the string “Would”, “Iike” and “poIicy” word keeps changing. Is there any regex to do this?
sampl textfile.txt (325 Bytes)

Hi @Lalitha_Selvaraj

InputString=System.Text.RegularExpressions.Regex.Matches(InputString,".*[A-Za-z0-9 ]+")

LogMessage
If(System.Text.RegularExpressions.Regex.IsMatch(currentMatch.ToString,"(?<=0\s*)([A-Za-z ]+)"),System.Text.RegularExpressions.Regex.Match(currentMatch.ToString,"(?<=0\s*)([A-Za-z ]+)").Value.Trim,"Nil")

Hope it helps!!

1 Like

If the input string is dynamic, which means “its a line of text from notepad” . what to do in that case?

@Lalitha_Selvaraj
Instead of Assign activity take Read text file and store output which is in the form of string.

image

The input file which is attached is a input of multiple text files. Here is the pdf image
image.
I’m extracting pdf text into a text file and the input which i have attached is one of the line in the text file.
sample text extracted from pdf
image

@Lalitha_Selvaraj

Okay.The solution Provided above will work for n number of lines.
Please try and ask me if you have any doubts.

Pass the text file which have extracted from PDF in the read text file and store the output as string and do do the flow.

1 Like

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