Question
Dynamically Adding '<a href>URL</a>' to Content's URL
Content people insert FQAs into a database table with plain
text (no html code) from time to time.
I will need dynamically find a url string within a content/paragraph, e.g.:
“… posted on the Internet at www.hre.com?id=68. The changes to the list …”
then replace the link to:
“… posted on the Internet at <a href=” http://www.hre.com?id=68”>www.hre.com?id=68</a>. The changes to the list …”
Right now what I did is manually put the “www.hre.com?id=68” into a database table, then replace it to “<a href=”www.hre.info?id=68”>www.hre.com</a>”.
I am not sure regular expression will help.
Is any CF function, such as len(), etc. to detect “www…”, or “ http://...” in a paragraph, then count the string’s length (www.hre.com?id=68), then replace with <a href /> tag?
Thanks in advance!
Kevin
I will need dynamically find a url string within a content/paragraph, e.g.:
“… posted on the Internet at www.hre.com?id=68. The changes to the list …”
then replace the link to:
“… posted on the Internet at <a href=” http://www.hre.com?id=68”>www.hre.com?id=68</a>. The changes to the list …”
Right now what I did is manually put the “www.hre.com?id=68” into a database table, then replace it to “<a href=”www.hre.info?id=68”>www.hre.com</a>”.
I am not sure regular expression will help.
Is any CF function, such as len(), etc. to detect “www…”, or “ http://...” in a paragraph, then count the string’s length (www.hre.com?id=68), then replace with <a href /> tag?
Thanks in advance!
Kevin
