Skip to content

Instantly share code, notes, and snippets.

@nasser
Created September 29, 2014 17:32
Show Gist options
  • Save nasser/0bbc959f48c5f8b3d890 to your computer and use it in GitHub Desktop.
Save nasser/0bbc959f48c5f8b3d890 to your computer and use it in GitHub Desktop.
ar = open("ar.txt").read
ar.force_encoding "utf-8"
print ar.split.map { |e| e.strip }.
reject { |e| e =~ /\d|\w/ }.
reject { |e| e.length > 2 }.
join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment