Replace pregmatch with ctype_digit.