[pcrepp] add support for named captures and fix some other bugs