Are there any best practices for handling case-insensitive patterns in preg_match?

When using preg_match in PHP, the issue of case-insensitive patterns can be solved by using the 'i' modifier at the end of the regular expression. This modifier allows the pattern to match regardless of the case of the letters.

$pattern = '/hello/i';
$string = 'Hello, World!';
if (preg_match($pattern, $string)) {
    echo 'Pattern found!';
} else {
    echo 'Pattern not found.';
}