|
 |
asp_web_howto thread: parsing tags out of a string
Message #1 by "nick" <nick@i...> on Fri, 28 Sep 2001 12:21:07
|
|
Hi all,
I have a string returned such as:
"<A HREF="attdown.asp?Folder=Inbox&attIndex=1&MsgID=00000">file 1</a> <a
HREF="attdown.asp?Folder=SentItems&attIndex=2&MsgID=0202020">file 2</a>"
I want to clear the <A HREF> tags out of it.
I have used
myString = Replace(myString, "</a>", "")
to get rid of the closing tags but as the link url is different for each
link and will be different each time the page is loaded how can i get rid
of the opening tag? Do i need to use the RegExp object and if so how do i
define the pattern that needs to be got rid of?
Thanks in advance,
Nick
Message #2 by Lou <mmlwin@t...> on Fri, 28 Sep 2001 12:27:47 +0100
|
|
try the Instr function
details at http://www.cisdept.csupomona.edu/hwang/cis451/vbs/105.htm
regards
Lou
-----Original Message-----
From: nick [mailto:nick@i...]
Sent: 28 September 2001 13:21
To: ASP Web HowTo
Subject: [asp_web_howto] parsing <a href> tags out of a string
Hi all,
I have a string returned such as:
"<A HREF="attdown.asp?Folder=Inbox&attIndex=1&MsgID=00000">file 1</a> <a
HREF="attdown.asp?Folder=SentItems&attIndex=2&MsgID=0202020">file 2</a>"
I want to clear the <A HREF> tags out of it.
I have used
myString = Replace(myString, "</a>", "")
to get rid of the closing tags but as the link url is different for each
link and will be different each time the page is loaded how can i get rid
of the opening tag? Do i need to use the RegExp object and if so how do i
define the pattern that needs to be got rid of?
Thanks in advance,
Nick
Message #3 by "nick" <nick@i...> on Fri, 28 Sep 2001 13:24:07
|
|
I can use the Instr position to get the "<a href="attdown.asp?folder="
portion of the link tag but how do i use Instr to find the next occurence
of "">"
If i search for ">" then this might occur in the string before the "<a
href" position
Message #4 by Lou <mmlwin@t...> on Fri, 28 Sep 2001 13:48:28 +0100
|
|
try using the "start" option - you can search after the first occurrence of
"<ahref"
-----Original Message-----
From: nick [mailto:nick@i...]
Sent: 28 September 2001 14:24
To: ASP Web HowTo
Subject: [asp_web_howto] RE: parsing <a href> tags out of a string
I can use the Instr position to get the "<a href="attdown.asp?folder="
portion of the link tag but how do i use Instr to find the next occurence
of "">"
If i search for ">" then this might occur in the string before the "<a
href" position
|
|
 |