So I found out that the word boundary works great to make sure that exactly that word is being found within the text and that we don't cut other words if they contain just parts of this word, however I noticed it works bad at the String start and end.
So ideally I would expect a regex like this also work well in string start and end, because that's where the word also starts/ends:
String regex1 = "\\b" + searchedWord + "\\b";
However it turned out I had to transform the regex like this to make sure it works well also for string start and end:
String regex2 = "(^|\\b)" + searchedWord + "($|\\b)";
I haven't discovered any side effects of using the latter regex yet, however I would like to know if there is any special boundary or how to write the boundary more efficiently to make it less ugly and less counter-intuitive.
Does anybody know better ways? Perhaps you can also improve my suggested regex as well in case you are aware of any problems using it.