Refactor stringly typed regexp flags to sum type