Matt_T_hat
Oct 11th, 2006, 02:22 AM
I wish to write a process that will automatically act on a block of text.
My first idea was to take the list of words and phrases and build a regex part like this [word1|word2|etcetc...] which would allow me to convert each word to a hyperlink.
However if more than one instence of any word is made into a link this will cause problems for the indexer which will list the block of text twice...
So I need to find only the first example of each word.
However, I need to be as fast as possible as each such lot of code slows down the text addition process and it is already a bit bogged.
Q. So what is the fastest way to do this?
Q. Is there a reasonably efficient way to do this and detect for user added links? (does it make any difference that the links could come in BBish, HTML or custom tag markup?)
Any clues at all would be helpfull at this stage.
My first idea was to take the list of words and phrases and build a regex part like this [word1|word2|etcetc...] which would allow me to convert each word to a hyperlink.
However if more than one instence of any word is made into a link this will cause problems for the indexer which will list the block of text twice...
So I need to find only the first example of each word.
However, I need to be as fast as possible as each such lot of code slows down the text addition process and it is already a bit bogged.
Q. So what is the fastest way to do this?
Q. Is there a reasonably efficient way to do this and detect for user added links? (does it make any difference that the links could come in BBish, HTML or custom tag markup?)
Any clues at all would be helpfull at this stage.