3 Answers
3

To get subtext 12121 use Regular expressions.
gsub performs a search-and-replace operation. It will search for all non-digit characters(/\D/) and replace with the given string.
In this case we are not giving any string to replace.