CODE.rb

code=’<html>
<head>
<title>title</title>
<meta content=”title” name=”keywords”/>
<meta content=”text/html; charset=iso-8859-1″ http-equiv=”Content-
Type”/>’

puts content= code.scan(%r{content=”(.*?)”}im).flatten[0].to_s
puts name=code.scan(%r{name=”(.*?)”}im).flatten.to_s

 

Output:

title
keywords

Leave a Reply