In preg statements, the patterns are encapsulated by delimiters. In Perl Compatible Regular Expressions, delimiters can be any non-whitespace, non alpha-numeric ASCII character other than the backslash.
The letters that immediately follow the closing delimiter (in this case as you see, both Nog and I chose # characters for delimiters), are called modifiers, which perform extra tasks to the pattern at hand.
As well as the links I provided above, you can read more about PCRE here. Regex isn't necessarily hard per-say, but rather tricky and intimidating at first.. but in time, as you keep playing around with it, you'll see it isn't so bad once you get to know it more.