In the PHP manual of PCRE, http://us.php.net/manual/en/pcre.examples.php, it gives 4 examples of valid patterns:
/<\/\w+>/|(\d{3})-\d+|Sm/^(?i)php[34]/{^\s+(\s+)?$}
Seems that / , | or a pair of curly braces can use as delimiters, so is there any difference between them?
No difference, except the closing delimiter cannot appear without escaping.
This is useful when the standard delimiter is used a lot, e.g. instead of
you can write
to avoid needing to escape the
/.