SyntaxFix
Write A Post
Hire A Developer
Questions
A simpler scan would be:
String1.scan(/<(\S+)>/).last