regex flags cleanup in file module

* Use named constants from `re` module instead of hardcoding concrete integer values.
* Use bitwise OR operator, per `re`'s docs