In Java, "\b" is a backspace character (char 0x08 ), which when used in a regular expression will match a backspace literal.
You need the regular expression a\b , which is encoded in java by escaping bask-slash, for example:
"a\\b"
btw, you only partially correctly relate the value of regex \b - this actually means "word boundary" (either the beginning or the end of the word).
source share