By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,546 Members | 862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,546 IT Pros & Developers. It's quick & easy.

remove hyperlinks?

P: n/a
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&am p;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;SearchSD R=&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.
Jul 22 '05 #1
Share this Question
Share on Google+
9 Replies

P: n/a
middletree wrote:
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.
Jul 22 '05 #2

P: n/a
What is pattern matching?
"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:#f**************@TK2MSFTNGP10.phx.gbl...
middletree wrote:
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.

Jul 22 '05 #3

P: n/a
middletree wrote:
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...sobjRegExp.asp
http://msdn.microsoft.com/library/en...expression.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.
Jul 22 '05 #4

P: n/a
I looked over both articles, and am still not clear on what this has to do
with what I am asking about.
"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:eL**************@TK2MSFTNGP12.phx.gbl...
middletree wrote:
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...sobjRegExp.asp
http://msdn.microsoft.com/library/en...jregexpression
..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.

Jul 22 '05 #5

P: n/a
"middletree" <mi********@verywarmmail.com> wrote in message
news:es**************@tk2msftngp13.phx.gbl...
[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")
%>
Jul 22 '05 #6

P: n/a
Now that's something I can understand.

Thanks!
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:#M**************@TK2MSFTNGP14.phx.gbl...
"middletree" <mi********@verywarmmail.com> wrote in message
news:es**************@tk2msftngp13.phx.gbl...
[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")
%>

Jul 22 '05 #7

P: n/a

"middletree" <mi********@HTOmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:#M**************@TK2MSFTNGP14.phx.gbl...
"middletree" <mi********@verywarmmail.com> wrote in message
news:es**************@tk2msftngp13.phx.gbl...
[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.
Jul 22 '05 #8

P: n/a
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:#G**************@TK2MSFTNGP10.phx.gbl...
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.
Jul 22 '05 #9

P: n/a
"middletree" <mi********@verywarmmail.com> wrote in message
news:OI**************@TK2MSFTNGP09.phx.gbl...
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:#G**************@TK2MSFTNGP10.phx.gbl...
>

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.

I'm glad we could help. :)
Jul 22 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.