What are the valid delimiters for regular expressions preg_*
?
I know we can use some of these ( /
, ~
and #
), as I show in the example below:
$numero = '0.12.13';
preg_replace('/\D+/', '', $numero); // string('01213')
preg_replace('~\D+~', '', $numero); // string('01213')
preg_replace('#\D+#', '', $numero); // string('01213')
But I would like to know the other regular expression delimiters (from PREG
) in PHP.
Can I use only special characters (and never numbers or letters)?
If yes, what are these special characters?