remove hyperlinks?

M

middletree

I have a page which takes data in an HTML table, and exports it to an Excel
file. It works fine, but I want several things about the spreadsheet to look
different from the HTML version. Things like fonts and colors. I think I can
use a style sheet for the latter, but I haven't figured out how to remove
hyperlinks from some of the items. On the HTML page, the hyperlinks are
useful, but I don't want the spreadsheet to have them.

So on my ASP page which builds the Excel file, I have this:

<TH vAlign=top align=left width="7%"><A
href="DisplaySortableTickets.asp?SearchYes=true&amp;selectTSE=200&amp;Assist
Emp=&amp;Status=&amp;Environment=&amp;CustomerCode=&amp;date1=&amp;date2=&am
p;DateSearch=&amp;Sort=TKTID&amp;SortToggle=1&amp;ReportType=&amp;ShowIntern
al=&amp;ShowExternal=&amp;searchtext=&amp;SearchSDR=&amp;SearchCustTicketID=
&amp;RootCauseID=&amp;CauseMatchType=">TKT ID:</A></TH>

How can I use ASP to remove the opening and closing <A> tags? A replace
function won't work, because it's different every time.
 
D

Dave Anderson

middletree said:
How can I use ASP to remove the opening and closing <A> tags? A
replace function won't work, because it's different every time.

Isn't that the whole point of pattern matching?



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
M

middletree

What is pattern matching?


Dave Anderson said:
Isn't that the whole point of pattern matching?



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
D

Dave Anderson

middletree said:
What is pattern matching?

It's a codified way of doing what you already do when you manually strip the
HTML from a piece of text. Both VBScript and JScript allow you to do this
with Regular Expression Objects:

http://msdn.microsoft.com/library/en-us/script56/html/vsobjRegExp.asp
http://msdn.microsoft.com/library/en-us/script56/html/js56jsobjregexpression.asp



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
M

middletree

I looked over both articles, and am still not clear on what this has to do
with what I am asking about.
 
C

Chris Hohmann

[snip]
How can I use ASP to remove the opening and closing <A> tags? A replace
function won't work, because it's different every time.

<%
Dim s, re
s = "<a href='test.html'>Hello World.</a>"
Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.Pattern = "<a .*?>(.*?)</a>"
Response.Write re.Replace(s,"$1")
%>
 
M

middletree

Now that's something I can understand.

Thanks!


Chris Hohmann said:
[snip]
How can I use ASP to remove the opening and closing <A> tags? A replace
function won't work, because it's different every time.

<%
Dim s, re
s = "<a href='test.html'>Hello World.</a>"
Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.Pattern = "<a .*?>(.*?)</a>"
Response.Write re.Replace(s,"$1")
%>
 
C

Chris Hohmann

middletree said:
Chris Hohmann said:
[snip]
How can I use ASP to remove the opening and closing <A> tags? A replace
function won't work, because it's different every time.

<%
Dim s, re
s = "<a href='test.html'>Hello World.</a>"
Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.Pattern = "<a .*?>(.*?)</a>"
Response.Write re.Replace(s,"$1")
%>

Now that's something I can understand.

Thanks!
Actually, in the long run, Dave's tactic is more worthwhile. He was trying
to bring you close enough to the answer so you could make the mental leap
for yourself. I GAVE you a fish, he tried to TEACH you how to fish. There a
world of difference between the two.
 
M

middletree

Chris Hohmann said:
Actually, in the long run, Dave's tactic is more worthwhile. He was trying
to bring you close enough to the answer so you could make the mental leap
for yourself. I GAVE you a fish, he tried to TEACH you how to fish. There a
world of difference between the two.

I totally understand. But it was so far above my head, covering several
things I have never seen before, that I couldn't make the leap. Your
example, combined with what I read in the articles referenced in his post,
have worked together quite well.
 
C

Chris Hohmann

middletree said:
I totally understand. But it was so far above my head, covering several
things I have never seen before, that I couldn't make the leap. Your
example, combined with what I read in the articles referenced in his post,
have worked together quite well.
I'm glad we could 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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top