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

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
agent86
Posts: 18
Joined: Wed Apr 26, 2006 2:59 am
Location: SF Bay Area

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

Post 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
agent86
Posts: 18
Joined: Wed Apr 26, 2006 2:59 am
Location: SF Bay Area

I figured the short string out...

Post 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 & "\>"
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post 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.
Post Reply