And of course, 10 minutes after sending the above, I found an
interesting twist (as I was checking for other places that might
suffer from the bug).
First of all, my advice about restoring the encoding is flawed. You
cannot define from no encoding to UTF-16, for example (you get
chinese garbage). You have to go to UTF-8. So converting back to
the original encoding is a no-go; you have to move to UTF-8
Next, I do a lot of massaging of my input before anything else
proceeds, using a simple string that contains all the lines. When I
operate on pasted text, that text comes in with no encoding, and
comes out of all the massages with UTF-16.
So those regex.replaces aren't messing with the encoding. The last
of those is this code:
rg.SearchPattern = "(Their scores \(not necessarily in order\)\:.+)
\r([0-9])"
rg.ReplacementPattern = "\1 \2"
while rg.search(s) <> nil
s = rg.Replace(s)
wend
The patterns that appear to cause the problem are:
fMoved2.searchPattern = "(.*)F([1-9][0-9]*)\[([^\]]*)\]-->W([0-9]+)
(.*)"
fMoved2.ReplacementPattern = "\1\5"
So I tried some variants to try and see if it was a pattern problem:
fMoved2.searchPattern = "([^F]*)F([1-9][0-9]*)\[([^\]]*)\]-->W
([0-9]+)(.*)"
fMoved2.searchPattern = "([^F]*)F([1-9][0-9]*)\[([^\]]*)\]-->W
([0-9]+)(.*)$"
fMoved2.searchPattern = "([^F]+)F([1-9][0-9]*)\[([^\]]*)\]-->W
([0-9]+)(.+)$"
Nope.
This is too weird for a Saturday afternoon.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>