regex flags cleanup in file module
Merge pull request #4814 from hulu/re-flags

regex flags cleanup in file module