in reply to Re: Substitute 'bad words' with 'good words' according to lists
in thread Substitute 'bad words' with 'good words' according to lists
Thank you both for the time it took you to write these responses.
pg I find your method interesting and agree that it is much more efficient than the one I came up with. Thanks for pointing me out a big mistake ( the number of iterations ).
jhourcle I must agree with the things you mentioned as additional problems that must be taken care of. This node was created not to accomplish some script but to seek a simillar method to the php one. The code you added along with your post is 'exactly' the anwser I was seeking, as it shows that it can be done almost exactly as in php. I tried a simillar solution by joining a list of bad words and a list of good words, but that was obviusly wrong as I did not know how to replace the word matched by the regex with the correspoding good word, you showed me that it can be done with a hash, and now I see how blind I was before. Thank you again, and thank you both for the time it took you to read this node and share your ideas.