- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
var_dump(preg_match('~^(hello\#world)\z~', 'hello#world'));
var_dump(preg_match('~^(hello\#world)\z~x', 'hello#world'));
var_dump(preg_match('~^(hello#world)\z~', 'hello#world'));
var_dump(preg_match('~^(hello#world)\z~x', 'hello#world'));