Skip to content

Instantly share code, notes, and snippets.

@dannguyen
Created February 26, 2011 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannguyen/845658 to your computer and use it in GitHub Desktop.
Save dannguyen/845658 to your computer and use it in GitHub Desktop.
class String
def xml_tag_getter(some_tag_word)
self.scan(/<#{some_tag_word}\>(.+?)<\/#{some_tag_word}>/).map{|p| p[0] if p}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment