- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
preg_match('/^[\w\.]+$/', 'admin.general.canViewPrivateUserOptions', $matches);
var_dump($matches);
preg_match('/^[\w-\.]+$/', 'admin.general.canViewPrivateUserOptions', $matches);
var_dump($matches);
preg_match('/^[\\w-\\.]+$/', 'admin.general.canViewPrivateUserOptions', $matches);
var_dump($matches);