s = 'a5bc2cdf3'index = 5res = s.gsub(/([a-zA-Z]+)(\d+)/){$1*$2.to_i}puts res[index]
Standard input is empty
b
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!