PHP: Needing regex to camelCase a dashed/underscored string & test result against native PHP functions

Solution:

public function getMethod($action){
    $pattern = array('/_(.?)/e', '/-(.?)/e', '/ (.?)/e');
    $action = preg_replace($pattern, 'strtoupper("$1")', $action);

    if (function_exists($action) || $action == 'list' || $action == 'new' || $action == 'sort')
        return '_'.$action;
    else if ($action == '')
        return 'index';
    else
        return $action;
}