Since right now you are only specifying the removal of numbers, this will work as a single line.
"555 r6ub6y i7s e7a0sy... w1o2w4.".gsub(/\d/,'').strip
It basically talks about removing all numbers and spaces of the leading / trailing.
Now your regular expression says delete everything except uppercase and lowercase letters. You do not know what other types of characters you want to delete, but something like this can work for you if you want only spaces and periods of upper and lower case.
"555 r6ub6y i7s e7a0sy... w1o2w4.".gsub(/[^a-zA-Z\s.]/,'').strip
Also, when including spaces in a regex, I always prefer to use \s instead of the intended space, such as [ ] , because I feel like it adds readability, because [a-zA-Z ] may be a typo and should not contain spaces, but [a-zA-Z\s] very definitely saying that I want spaces.
Want to know more about Regex Rubular validation , it is a regular expression regulator for Ruby, and I use it all the time. The only thing that doesn't really discuss is greedy and non-greedy capture groups, but I have a feeling that you don't need to worry about it right now.
source share