The regex pattern is carefully constructed to ensure that it matches exactly the items specified by the user in their entirety, without matching any other parts of the text. By listing all the target strings explicitly using the pipe (|) as an OR operator, the pattern ensures precise matches while avoiding non-target parts in the context. Special characters and spaces are escaped appropriately to maintain correctness while interpreting the pattern properly. This approach adheres to the rules of the regex game.