Problems Replacing ASP Tags

General questions about using TextPad

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

Post Reply
JC

Problems Replacing ASP Tags

Post by JC »

Hi all!

I'm trying to create a regular expression to replace all lines, similar to the following:

<% PageTitle = "Blah" %>

With:

<title>Blah</title>

The content of the PageTitle variable, "Blah" in this example, should remain untouched. I've spent God knows how long trying all sorts of expressions to do this with no luck.

Is it possible? If so, how?

JC
Roy Beatty

Re: Problems Replacing ASP Tags

Post by Roy Beatty »

Find:::: ^<% PageTitle = "\(.+\)" %> *$<br>
Replace: <title>\1</title>

The ^ in the Find regex anchors the expression to the start of a line. The $ anchors it to the end. The " *" permits trailing blanks.

If the expression occurs in the midlle of some lines, then leave off the anchors and the trailing-blanks pattern.

HTH, Roy
JC

Re: Problems Replacing ASP Tags

Post by JC »

Thank you ever so much!

I was certain I had the basic jist of it all but it seems I need to study my expression syntax a little more.

Again thank you.

JC
Post Reply