I'm using AltoRouter to make the page call of my project, and in the doc it says that to use "Custom Match Types" just add
$router->addMatchTypes(array('cId' => '[a-zA-Z]{2}[0-9](?:_[0-9]++)?'));
However, I tried using this rule: |^[\pL\s]+$|u
, which validates letters (including accents) and spaces and did not work, I saw that the default rules that are in the class are like this:
protected $matchTypes = array(
'i' => '[0-9]++',
'a' => '[0-9A-Za-z]++',
'h' => '[0-9A-Fa-f]++',
'*' => '.+?',
'**' => '.++',
'' => '[^/\.]++',
);
I also tried to insert the rule already in the class and also did not succeed, I understand very little of Regex, but it seems that the standard rules are written in a different and "lean" way, following this pattern, how can I validate only letters (including accents), spaces and numbers?