Apparently the change I made the other day caused a problem. Replacing carriage returns with line feeds has to be handled a little more carefully. I had forgotten that carriage returns are often paired with line feeds. This is an old Windows (DOS) formatted text standard. So if for example you copied some HTML from a text editor and pasted it into the target string, you'll most likely have both carriage returns and line feeds marking the end of every line. The problem then with what I was doing is that I end up with 2 line feeds for every line. That meant that in this scenario the highlighting for a match was shifted downward.
The solution of course was to look for that carriage return/line feed combo first and replace it with a single line feed, and then replace any left over carriage returns after that. This solves the problem and once again makes Regex Hero a dependable tool to use for testing .NET regular expressions.
The solution of course was to look for that carriage return/line feed combo first and replace it with a single line feed, and then replace any left over carriage returns after that. This solves the problem and once again makes Regex Hero a dependable tool to use for testing .NET regular expressions.
Comments
Post a Comment