Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created January 22, 2013 12:34
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 leejarvis/baa007793b683ce3c5ca to your computer and use it in GitHub Desktop.
Save leejarvis/baa007793b683ce3c5ca to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
DATA.readlines.each do |line|
if (line =~ /start/) .. (line =~ /end/)
puts "between start and end: #{line}"
else
puts "not between start and end: #{line}"
end
end
__END__
foo
bar
start
inside
blah
this is the end
baz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment