meaning of `$/i` in regular expressions

php, regex

Solution

`/` denotes the end of the pattern. The `i` is a modifier that makes the pattern case-insensitive, and the `$` anchor matches the end of the string.

Problem

What does the `$/i` mean in the following php code? ``` preg_match ('/^[A-Z \'.-]{2,20}$/i') ```

Original source