/\[\d+\]/.match("text[2]") # => "2" Nice!
/\[\d+\]/.match("text[2]_plus[4]") # => "2" # Problem
/\[\d+\]+/.match("text[2]_plus[4]") # => "2" Problem i need "4", the last
'text[2]_plus[4]'.scan(/\[\d+\]/) #=> ["[2]", "[4]"]
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill