smacca
asked on
Parse text and create HTML links where appropriate
I am looking for the following stored procedure:
CREATE PROCEDURE spActivateLinks
@text varchar(8000)
AS
-- all code would go here
GO
-------------------
I simply want it to activate any potential HTML links that are contained in the text passed to it.
The following text would be parsed and converted to a link:
* External sites - "http://", "news://", "ftp://" etc etc
* Local Links - "/news" or "/news/" etc etc
-----------------
Alternatively, this can be achieved in C# but I would prefer it in SQL.
*
CREATE PROCEDURE spActivateLinks
@text varchar(8000)
AS
-- all code would go here
GO
-------------------
I simply want it to activate any potential HTML links that are contained in the text passed to it.
The following text would be parsed and converted to a link:
* External sites - "http://", "news://", "ftp://" etc etc
* Local Links - "/news" or "/news/" etc etc
-----------------
Alternatively, this can be achieved in C# but I would prefer it in SQL.
*
Does you text already have some html tags
like
<HTML>
<BODY>
your text here
</BODY>
</HTML>
??
Could you post a sample text for us to work on ?
Hilaire
like
<HTML>
<BODY>
your text here
</BODY>
</HTML>
??
Could you post a sample text for us to work on ?
Hilaire
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree with hilaire here. I'm sure it would be possible to do some sort of string replacement. however the problem is that it would be much more effecient and easier to use a language that supports reg expressions
I agree with the above. It's not totally clear what you're working with, but usually it's the client application that decides if a link is encoded as an HREF--not the database app....
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I was wondering, does anyone know how to do this in ASP?
ASKER
* Notice how the "http://" and "ftp://" have been made into links.
That is EXACTLY what I want to achieve.
Cheers.