The current Implementation of XWPFParagraph.searchText(...) is basically a buggy version of the KMP Algorithm to search text (https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm) Example: Searched = "yoyoPlayer" Text = "yoyoyoPlayer" Result = null, expected = found at beginChar=2 The testcase, a lengthy explanation of the bug's cause and the fix are provided in this repo: https://github.com/fsomme2s/apache-poi-bug57727 Go to test class 'YoyoPlayerTest' (test folder). The fix is provided in class 'FixedParagraphSearchText' (main folder) Note: In a second test case I also demonstrate the bug 57727, which is also fixed in the FixedParagraphSearchText class. Sorry for the mess