Skip to content

Instantly share code, notes, and snippets.

@oleander
Last active August 29, 2015 14:07
Show Gist options
  • Save oleander/21b57c821f6706f512e5 to your computer and use it in GitHub Desktop.
Save oleander/21b57c821f6706f512e5 to your computer and use it in GitHub Desktop.
require "pp"
a = "A\s+(.+?)"
b = "[\n]+B\s+(.+?)"
c = "[\n]+C\s+(.+?)"
d = "[\n]+D\s+((?=E)[^E]+|[^\n]+)"
e = "[(?=[\n]+E\s+)[\n]+E\s+(.+?)\n]?"
pp File.read("ord.txt").scan(/(^\d{1,2})\.\s+(.+?(?=A\s+))#{a}#{b}#{c}#{d}#{e}/m).to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment