Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: string diff and compareby raybies (Chaplain) |
on May 07, 2012 at 13:48 UTC ( [id://969263]=note: print w/replies, xml ) | Need Help?? |
So I found an interesting failure of this approach when I was trying out this on more data. It occurs when I have the following sort of data.
Essentially, I end up creating the following output.
The problem is due to the fact that the space before the not (in "am not me"), and the space after the not are not the same space, but the matching can't tell that and because you search from the back of the string first, and then the front of the string, yet both are fine with the space between "am me." so the offsets are off by one. fixing now... a quick solution is to arbitrarily add one to the negative index, but it's clearly imperfect, because when this isn't the case, it'll highlight (span) one extra matching character.
In Section
Meditations
|
|