I want to compare two strings and highlight their exact differences, up until i was simply using StringUtils.difference , but the requirement now is to highlight the exact difference like Beyond Compare and other differencing tool. I thought of using BC script from java and generating report in html, later extract data from it or show it as is, but then it occurred that BC is a proprietary software and I would have to ask them to buy the software (because am using BC.exe in the script command) So the question is
1) Is there a way to call BeyondCompare from java and use it any other manner (that isnt illegal). Perhaps a library? 2) If not any other GPL tool that provides this byte to byte comparison, to be more precise if "a+b" and "a-b" only "-" should be highlighted(not just the line of change, I found most GPL tools only provide that, I could be wrong). 3) Is there an effective algorithm that I could implement and achieve the intended behaviour.
Long post, please be kind.. :|