Improve a regexp of migrator

Also, add a test case that was working before