Can you post the full code?
The script is in excess of 1200 lines in size. But let me see what I can do.
Are you at some point replacing semi-colons with an escape character? If so, you need to make sure that it's the first step of the process, before you make any other replacements... Same goes for ampersands and hash-tags, of course.
The semicolons are not escaped. (I assume you mean something like this: "\;"). I admit I tried it, but it made no difference.
I was actually referring to the entity code for a semi-colon (;), an ampersand (& or &) and a hash-tag (#).
Do you have those in your list? Do you see why replacing those symbols might be problematic if not done in the correct order?
You are actually very close to what the problem turned out to be. It was/is a stupid mistake caused by the changing requirements of management (and the incompetence of the programmer, I have to confess).
At the script’s genesis I was told to remove all punctuation, including the semicolon. Several months later I was told to isolate special characters and convert them to their HTML special codes, all of which are concluded with semicolons. That turned out to be the culprit. As a semicolon is punctuation, I would first change the special chars to their HTML code and then run the data through the “RemovePunctuation” function. Of course, the latter saw the semicolon and removed it.
Now that I know the culprit, it is a simple matter of writing logic that removes the semicolons that are indeed punctuation and leaving the semicolons that are part of HTML codes intact.
I thank you for your kind help. If you hadn’t contributed your words of wisdom I might still be fussing over what the problem is in the first place instead of designing the solution.
I will be marking your responses as ”helpful.”