Remove string occuring multiple times

Hi All,

I need to remove the highlighted text/string from text file which is occurring multiple times.
Stating from “Page” to “www.abc.com”.

I tried using index of both and used remove option ,however it is deleting only the first part of the string where it is present,for other parts where the same string is present how to remove.

Any way i can remove in one go or iteration thru loop somehow.

Dear,
You can use there replace
like
YourString.tostring.replace(“Enter your all string who you want to remove”," ")

Thanks & Regards
Bagish Ojha

@bagishojha page “2” of 4 ,no is changing.

please
show me your code or screenshot

I’m using string.remove(string.IndexOf(“Page”),string.indexof(“page”)+200)

this is removing the string on its first occurrence,but not all the occurrence.

Hi @prateekjain1992

Try this:
(?=Page).+?(?<=abc\.com$)","")

Click here to see it in action.

You can use Replace activity, but make sure the Single Line option is selected:
image

1 Like

hi @loginerror ,

thanks for the help,the regex is working fine when I am testing on regextester.

However in uipath it is not able to find,i have selected all three options in regexoption.

Can you help on this.

@prateekjain1992

Indeed, the issue was with the $ character. It will work when you remove it, see example:
SimpleRegexTry.zip (1.9 KB)

Thanks,it worked.