enh: replace id extraction with regular expression