How do I replace HTML tags without changing the text?

T

Tom M

I am trying to replace a tag such as <p class="Name">Title of Page</p>

with <span class="Header">Title of Page</span>

The problem is that the text inside the tags, ie "Title of Page" varies over
the 500 pages that I need to change it. I am wondering if there are wildcard
characters that I can use with Find/Replace to preserve the text inbetween
the tags while changing the tags on all the pages at once.

I know that I can just change the opening tag, or change both tags while
deleting the text but I want to save the time of either replacing the closing
</span> tag or retyping the text inside the text. I remember doing something
similar before and I thought that I could use asterisks but that is not
working in FP 2003 and I do not remember exactly what I did.

Thanks in advance for any help.
 
S

Steve Easton

You don't need to search and replace the entire tag, you can just search and
replace a portion of it like this.

Search for : <p class="Name">

Replace with: <span class="Header">

hth


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
T

Tom M

Thanks, but I already know this. The problem is I will still need to replace
all the </p> tags across every page. However, since that tag is used in
multiple instances, I would need to do it manually which is why I am
wondering if there is some way to ignore the text between the tags and
perform the find/replace in one operation.
 
A

Andrew Murray

Then search and replace </p> with </span> ????

Usually the search and replace routine will prompt at every occurence of the
string to be replaced with a "Replace Y/N?" option rather than just doing
the lot and not giving you the choice.
 
S

Stefan B Rusynko

That will destroy any other valid <p> tags

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Then search and replace </p> with </span> ????
|
| Usually the search and replace routine will prompt at every occurence of the
| string to be replaced with a "Replace Y/N?" option rather than just doing
| the lot and not giving you the choice.
|
|
| | > Thanks, but I already know this. The problem is I will still need to
| > replace
| > all the </p> tags across every page. However, since that tag is used in
| > multiple instances, I would need to do it manually which is why I am
| > wondering if there is some way to ignore the text between the tags and
| > perform the find/replace in one operation.
| >
| > "Steve Easton" wrote:
| >
| >> You don't need to search and replace the entire tag, you can just search
| >> and
| >> replace a portion of it like this.
| >>
| >> Search for : <p class="Name">
| >>
| >> Replace with: <span class="Header">
| >>
| >> hth
| >>
| >>
| >> --
| >> Steve Easton
| >> Microsoft MVP FrontPage
| >> 95isalive
| >> This site is best viewed............
| >> ........................with a computer
| >>
| >>
| >>
| >>
| >> | >> >I am trying to replace a tag such as <p class="Name">Title of Page</p>
| >> >
| >> > with <span class="Header">Title of Page</span>
| >> >
| >> > The problem is that the text inside the tags, ie "Title of Page" varies
| >> > over
| >> > the 500 pages that I need to change it. I am wondering if there are
| >> > wildcard
| >> > characters that I can use with Find/Replace to preserve the text
| >> > inbetween
| >> > the tags while changing the tags on all the pages at once.
| >> >
| >> > I know that I can just change the opening tag, or change both tags
| >> > while
| >> > deleting the text but I want to save the time of either replacing the
| >> > closing
| >> > </span> tag or retyping the text inside the text. I remember doing
| >> > something
| >> > similar before and I thought that I could use asterisks but that is not
| >> > working in FP 2003 and I do not remember exactly what I did.
| >> >
| >> > Thanks in advance for any help.
| >>
| >>
| >>
|
|
 
S

Stefan B Rusynko

In S&R, use the Html tag tab (replace tag <p> w/ tag <span>) w/ a Html rule to only find <p> tags w/ your class attribute

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I am trying to replace a tag such as <p class="Name">Title of Page</p>
|
| with <span class="Header">Title of Page</span>
|
| The problem is that the text inside the tags, ie "Title of Page" varies over
| the 500 pages that I need to change it. I am wondering if there are wildcard
| characters that I can use with Find/Replace to preserve the text inbetween
| the tags while changing the tags on all the pages at once.
|
| I know that I can just change the opening tag, or change both tags while
| deleting the text but I want to save the time of either replacing the closing
| </span> tag or retyping the text inside the text. I remember doing something
| similar before and I thought that I could use asterisks but that is not
| working in FP 2003 and I do not remember exactly what I did.
|
| Thanks in advance for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top