Page 1 of 1

Remove text enclosed by < and > as well as the < an

Posted: Sun Dec 01, 2013 5:15 pm
by agent86
I need to replace a string...

<ReportTable1>[EmbeddedReport1]efrm goes here[/EmbeddedReport1]

with empty string. So I guess it might better be described as finding and deleting the string<ReportTable1>[EmbeddedReport1]efrm goes here[/EmbeddedReport1]

The number 1 could be any number from 1-99.

Also what would I need to do if the string was <ReportTable1> and not the longer string?

Thanks

I figured the short string out...

Posted: Sun Dec 01, 2013 8:36 pm
by agent86
I figured out the short string. I will apply it to the longer string and see if it works as well.


ReportInstance = 1

strSearchString = "\<ReportTable efrm" & ReportInstance & "\>"

Posted: Mon Dec 02, 2013 6:32 pm
by jeffy
If I'm understanding you, this regular expression would work:

Code: Select all

<ReportTable([0-9]{1,2})>\[EmbeddedReport\1\]efrm goes here\[/EmbeddedReport\1\]
This assumes the number is the same in all locations throughout the line.