Using Ruby... Given a String x = "blah_blah.do.dah[4543]junk_junk"
How do I remove all text after the last number/digit?
I thought the easiest way to do this might be by finding the index of last occurence and then removing everything after that index. However, I can't seem to figure out how to obtain that index. All my attempts at using regex have failed.
Any helps is greately appreciated!