Updated to add proper regex parsing