Fix regex and add phpdoc;