How can the regex pattern in the provided PHP code be modified to correctly recognize the "&" character?

The issue with the provided regex pattern is that the "&" character is a special character in regex and needs to be properly escaped to be recognized as a literal "&" character. To solve this issue, we need to escape the "&" character in the regex pattern by adding a backslash "\" before it.

// Original regex pattern
$pattern = '/^[a-zA-Z0-9\s]+$/';

// Modified regex pattern to recognize "&" character
$pattern = '/^[a-zA-Z0-9\s&]+$/';