Some flaw in the Boyer-Moore algorithm implementation in StrUtils.
Original Reporter info from Mantis: avk @avk959
-
Reporter name: avk
Original Reporter info from Mantis: avk @avk959
- Reporter name: avk
Description:
It seems that FindMatchesBoyerMooreCaseSensitive (and of course FindMatchesBoyerMooreCaseInSensitive) cannot find all occurrences of a pattern in a given text if the pattern has some periodicity.
For example, for the pattern "abcab" and the text "abcabcabcabcabcabcab" it indicates matches at positions 1, 7, and 13, but it should be 1, 4, 7, 10, 13.
Hope that the attached patch fixes the problem.
Mantis conversion info:
- Mantis ID: 38513
- OS: any
- OS Build: any
- Build: 48715
- Platform: any
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 48752 (#17a3ca31)