It's OK, I think I've found the answer to my own question. The # signs bracket the actual regular expression, and the e and the s are modifiers - e is equivalent to PREG_REPLACE_EVAL and s is equivalent to PCRE_DOTALL. Maybe these are things which are so familiar to the experienced players that they almost go without saying, but it's amazing how tricky it is to find such things out by searching through the PHP help file or by Googling. Queries like
PHP preg_match_all pound
returned nothing useful, at least not in the first few hits. I finally found a helpful page by Googling
PHP pcre_dotall pound
but I'd never have thought to search for such a combination of terms if I didn't almost have the answer already.