Skip to content

Instantly share code, notes, and snippets.

@matasar
Created May 16, 2016 22:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matasar/5e6c3c82b43ba4791b317156a1963e9c to your computer and use it in GitHub Desktop.
Save matasar/5e6c3c82b43ba4791b317156a1963e9c to your computer and use it in GitHub Desktop.
def n5s(str)
first, num, last = str.match(/([a-zA-Z])(\d+)([a-zA-Z])/).captures
num = num.to_i
puts open("/usr/share/dict/words").grep(/\b#{first}[a-zA-Z]{#{num}}#{last}\b/)
end
> n5s("i18n")
institutionalization
intercrystallization
interdifferentiation
internationalization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment