r-lib/rex

Simplify one character regexs

Closed this issue · 1 comments

When a regex has only one character you don't technically have to group them. I am not sure it is worth doing however, it should not affect the regex perfomance (hopefully) to leave the groups. You also would have to have additional logic to ensure the regex is not become wrong as a result of the simplification (| is one which will be tricky to handle without grouping everything)

This would introduce too many bugs to do without every function having knowledge of the entire regex, so we are punting on it.