How can I extract a substring from within a string in Ruby?
Example:
String1 = \" \"
I want to extract
String1.scan(/<([^>]*)>/).last.first
scan creates an array which, for each in String1 contains the text between the < and the > in a one-element array (because when used with a regex containing capturing groups, scan creates an array containing the captures for each match). last gives you the last of those arrays and first then gives you the string in it.