Refactor RepositoryArgumentTransformer::transformRegex to be more readable