Page 1 of 1

Problems Replacing ASP Tags

Posted: Thu Aug 02, 2001 10:35 am
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

Re: Problems Replacing ASP Tags

Posted: Thu Aug 02, 2001 2:22 pm
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

Re: Problems Replacing ASP Tags

Posted: Fri Aug 03, 2001 8:02 am
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