@guyjantic
You need to make that greedy. Might be as easy as
sub("(^.*?)(\\d{2,5})(.*?$)", "\\2", strings)
This makes the matches before and after "lazy", meaning they match as few as possible.
Edit: I didn't test it due to on my phone now.
@guyjantic
You need to make that greedy. Might be as easy as
sub("(^.*?)(\\d{2,5})(.*?$)", "\\2", strings)
This makes the matches before and after "lazy", meaning they match as few as possible.
Edit: I didn't test it due to on my phone now.