regexp improvements for import handling