added regex functionality