Word Boundaries
A word boundary is a zero-width test between two characters. To pass the test, there must be a word character on one side, and a non-word character on the other side. It does not matter which side each character appears on, but there must be one of each.
Table 2 defines word characters. For the word boundary test only, which must always have two characters to consider, the beginning and end of the string are considered non-word characters.
HELLO WORLD!HELLO W|ORLD!Because the characters W and O are both word characters, the imaginary line is not on a word boundary, and the test fails.
|HELLO WORLD!For this test, there is only one real character, H, so the beginning of the string counts as the second character. Since H is a word character, and the beginning of the string is considered a non-word character (for the word boundary test only), the imaginary line is on a word boundary, and the test passes.