Board Thread:Support Requests - Getting Technical/@comment-3225604-20150614103358/@comment-26235098-20150711074131

Wildones,

A couple thoughts. You really need to see an input string. One can't know if a regular expression works for a given source and target, without knowing the source format.

One thing you could do is comment out all of the replace instructions and send ChatLog out un-formatted, wrapped in a pre tag. You only need do this once -- you'll get an immediate picture of the source format.

Another way would just be to bring it up in debug, but for this you'd need a string your own brain can handle, so reduce the time interval to something small... 2 mins tops, depending how busy chat is.

The replace seems to me to be "eating" one leading character and then sticking the username in there before spaces, not prepending text with a user name. Also, it seems to append the same timestamp & user id sequence after each message, following the linefeed. Now either I am wrong about this, or it is then somehow removing these extra tags. But have a look yourself - I plugged the actual arguments your replace call uses into the regexp evaluator Shinging Armor gave (thanks!):

https://regex101.com/r/tG1bS3/6

Once you know the format (either through debug or writing raw with a pre tag), fiddle with the input string in the regexp tool so that it matches the input format. To simulate attempts at successive passes through the while loop, copy the entire output window into the input window. I'm wondering if something could be causing it to stick in that while loop. We checked memory, but what about processor usage when it hangs?

Another thought is to rewrite that stuff to write the user messages into an array of strings, do an appropriate replace on each as well as the wiki-image/a-tag fixup replace, then use join on the array to concat the strings into ChatLog (more efficient). I'd probably do this just on principle, but you'll likely have to rewrite or tweak the regexps and this won't spare you time in debug at first. If there's a performance problem though, this might fix it.