Delimiters of Regular Expressions in PHP
Not only #, but also any other characters
(except letters and digits) can act as delimiters.
For example, let's take the ampersand symbols
as delimiters:
<?php
echo preg_replace('&a+&', '!', 'text');
?>
If brackets are used, then the left delimiter is the opening bracket, and the right one is the closing bracket:
<?php
echo preg_replace('(a+)', '!', 'text');
?>
Use the tilde symbol ~ as delimiters.