Split out RE_FLAGS
... instead of having it duplicated in RE_PROFILE_HAT_DEF and RE_PROFILE_START.
Note that the flags=... handling in RE_PROFILE_HAT_DEF was more/too strict (for example it didn't allow whitespace around the "="), so this change also qualifies as a little bugfix.