How to check if the last line of text contains special characters

How to check if the last line of text contains special characters?I always need to check the file’s last line if it contains lv.exe.I also refer to the topic:How to check if last line of text file contains one word?, but it returns to the error:2020-01-13_11-46-15

sample.txt (774 Bytes)

Try This

Here Datatest is Output Varible of Read Text File

1 Like

welcome back to uipath community
Kindly try like this
bool_output = System.Text.RegularExpressions.Regex.IsMatch(strinput.tostring.Split(Environment.Newline.ToArray()).Last().ToString,“(.exe)”)

Cheers @bfhuang

1 Like

Can you please tell me where is the part which looks for special characters?


.exe is the one we want to search and to ensure whether its there or not right… buddy
for that we can directly mention that instead of mentioning the special characters \W
if we know the exact special character then we can include that in the ISMATCH argument, as if we mention \W it will even include Space as a special non word character

thats why mentioned .exe as a match to be found directly


1 Like

Thank You

1 Like

Cheers @iVishalNayak

thanks a lot, it works.

This also works, thanks all the same.


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