What are the potential consequences of not properly escaping special characters in PHP regular expressions?

Not properly escaping special characters in PHP regular expressions can lead to syntax errors or unexpected behavior in pattern matching. To solve this issue, special characters such as ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\", and "/" should be escaped with a backslash "\" to be treated as literal characters in the regular expression pattern.

$pattern = '/\bexample\.com\b/';