What is the significance of the "#xy$#S" pattern in the preg_match function in PHP, and how does it affect the matching process?

The "#xy$#S" pattern in the preg_match function in PHP is used to perform a case-sensitive matching of a regular expression. This pattern ensures that the matching process will consider the case of the characters in the string being evaluated. If you want to perform a case-insensitive matching, you can omit the "S" modifier from the pattern.

$string = "Hello World";
$pattern = "/hello/i"; // case-insensitive matching
if (preg_match($pattern, $string)) {
    echo "Match found!";
} else {
    echo "No match found.";
}